Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[pandora-kernel.git] / mm / vmalloc.c
index 56faf31..b669aa6 100644 (file)
@@ -1593,8 +1593,8 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
        return area->addr;
 
 fail:
-       warn_alloc_failed(gfp_mask, order, "vmalloc: allocation failure, "
-                         "allocated %ld of %ld bytes\n",
+       warn_alloc_failed(gfp_mask, order,
+                         "vmalloc: allocation failure, allocated %ld of %ld bytes\n",
                          (area->nr_pages*PAGE_SIZE), area->size);
        vfree(area->addr);
        return NULL;
@@ -1625,13 +1625,12 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
 
        size = PAGE_ALIGN(size);
        if (!size || (size >> PAGE_SHIFT) > totalram_pages)
-               return NULL;
+               goto fail;
 
        area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST,
                                  start, end, node, gfp_mask, caller);
-
        if (!area)
-               return NULL;
+               goto fail;
 
        addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller);
 
@@ -1649,6 +1648,12 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
        kmemleak_alloc(addr, real_size, 3, gfp_mask);
 
        return addr;
+
+fail:
+       warn_alloc_failed(gfp_mask, 0,
+                         "vmalloc: allocation failure: %lu bytes\n",
+                         real_size);
+       return NULL;
 }
 
 /**