Skip to content

Commit

Permalink
kmemleak: Do not report alloc_bootmem blocks as leaks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Catalin Marinas committed Aug 27, 2009
1 parent fd67896 commit 008139d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mm/bootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,11 @@ static void * __init alloc_bootmem_core(struct bootmem_data *bdata,
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;
}

Expand Down

0 comments on commit 008139d

Please sign in to comment.