mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-12 09:28:21 +07:00
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>
This commit is contained in:
parent
fd6789675e
commit
008139d914
@ -521,7 +521,11 @@ static void * __init alloc_bootmem_core(struct bootmem_data *bdata,
|
|||||||
region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) +
|
region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) +
|
||||||
start_off);
|
start_off);
|
||||||
memset(region, 0, size);
|
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;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user