kmemleak: Do not report alloc_bootmem blocks as leaks
authorCatalin Marinas <catalin.marinas@arm.com>
Thu, 27 Aug 2009 13:29:17 +0000 (14:29 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 27 Aug 2009 13:29:17 +0000 (14:29 +0100)
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>
mm/bootmem.c

index 701740c9e81bdf967062b340e53cff8b7913427a..555d5d2731c6d963a66db15d9eb66aa03e9d6c8d 100644 (file)
@@ -521,7 +521,11 @@ find_block:
                region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) +
                                start_off);
                memset(region, 0, size);
-               kmemleak_alloc(region, size, 1, 0);
+               /*
+                * The min_count is set to 0 so that bootmem allocated blocks
+                * are never reported as leaks.
+                */
+               kmemleak_alloc(region, size, 0, 0);
                return region;
        }