OHCI: add a quirk for ULi M5237 blocking on reset
[firefly-linux-kernel-4.4.55.git] / mm / vmalloc.c
index b12fd8612604f26bfca3006fd07bcbad27d73040..d4565606cc96867a908b0881544e253f0c910bbf 100644 (file)
@@ -388,12 +388,12 @@ nocache:
                addr = ALIGN(first->va_end, align);
                if (addr < vstart)
                        goto nocache;
-               if (addr + size - 1 < addr)
+               if (addr + size < addr)
                        goto overflow;
 
        } else {
                addr = ALIGN(vstart, align);
-               if (addr + size - 1 < addr)
+               if (addr + size < addr)
                        goto overflow;
 
                n = vmap_area_root.rb_node;
@@ -420,7 +420,7 @@ nocache:
                if (addr + cached_hole_size < first->va_start)
                        cached_hole_size = first->va_start - addr;
                addr = ALIGN(first->va_end, align);
-               if (addr + size - 1 < addr)
+               if (addr + size < addr)
                        goto overflow;
 
                if (list_is_last(&first->list, &vmap_area_list))
@@ -1522,6 +1522,8 @@ static void __vunmap(const void *addr, int deallocate_pages)
  *     Must not be called in NMI context (strictly speaking, only if we don't
  *     have CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG, but making the calling
  *     conventions for vfree() arch-depenedent would be a really bad idea)
+ *
+ *     NOTE: assumes that the object at *addr has a size >= sizeof(llist_node)
  *     
  */
 void vfree(const void *addr)