Commit 286e1ea3ac1ca4f503ebbb3020bdb0cbe6adffac

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent c430169e0c

[PATCH] vmalloc(): don't pass __GFP_ZERO to slab

A recent change to the vmalloc() code accidentally resulted in us passing
__GFP_ZERO into the slab allocator.  But we only wanted __GFP_ZERO for the
actual pages whcih are being vmalloc()ed, and passing __GFP_ZERO into slab is
not a rational thing to ask for.

Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 5 additions and 2 deletions Side-by-side Diff

... ... @@ -428,8 +428,11 @@
428 428 if (array_size > PAGE_SIZE) {
429 429 pages = __vmalloc_node(array_size, gfp_mask, PAGE_KERNEL, node);
430 430 area->flags |= VM_VPAGES;
431   - } else
432   - pages = kmalloc_node(array_size, (gfp_mask & ~__GFP_HIGHMEM), node);
  431 + } else {
  432 + pages = kmalloc_node(array_size,
  433 + (gfp_mask & ~(__GFP_HIGHMEM | __GFP_ZERO)),
  434 + node);
  435 + }
433 436 area->pages = pages;
434 437 if (!area->pages) {
435 438 remove_vm_area(area->addr);