Commit 008139d9146f9afee0e58df4b7422d0c9921f8ce

Authored by Catalin Marinas
1 parent fd6789675e

kmemleak: Do not report alloc_bootmem blocks as leaks

This patch sets the min_count for alloc_bootmem objects to 0 so that
they are never reported as leaks. This is because many of these blocks
are only referred via the physical address which is not looked up by
kmemleak.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>

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

... ... @@ -521,7 +521,11 @@
521 521 region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) +
522 522 start_off);
523 523 memset(region, 0, size);
524   - kmemleak_alloc(region, size, 1, 0);
  524 + /*
  525 + * The min_count is set to 0 so that bootmem allocated blocks
  526 + * are never reported as leaks.
  527 + */
  528 + kmemleak_alloc(region, size, 0, 0);
525 529 return region;
526 530 }
527 531