kmemleak: Add callbacks to the bootmem allocator

This patch adds kmemleak_alloc/free callbacks to the bootmem allocator.
This would allow scanning of such blocks and help avoiding a whole class
of false positives and more kmemleak annotations.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>

+6
+6
mm/bootmem.c
··· 12 12 #include <linux/pfn.h> 13 13 #include <linux/bootmem.h> 14 14 #include <linux/module.h> 15 + #include <linux/kmemleak.h> 15 16 16 17 #include <asm/bug.h> 17 18 #include <asm/io.h> ··· 336 335 { 337 336 unsigned long start, end; 338 337 338 + kmemleak_free_part(__va(physaddr), size); 339 + 339 340 start = PFN_UP(physaddr); 340 341 end = PFN_DOWN(physaddr + size); 341 342 ··· 356 353 void __init free_bootmem(unsigned long addr, unsigned long size) 357 354 { 358 355 unsigned long start, end; 356 + 357 + kmemleak_free_part(__va(addr), size); 359 358 360 359 start = PFN_UP(addr); 361 360 end = PFN_DOWN(addr + size); ··· 521 516 region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) + 522 517 start_off); 523 518 memset(region, 0, size); 519 + kmemleak_alloc(region, size, 1, 0); 524 520 return region; 525 521 } 526 522