Commit 6e44bd6d authored by Mike Rapoport's avatar Mike Rapoport
Browse files

memblock: exclude NOMAP regions from kmemleak

Vladimir Zapolskiy reports:

commit a7259df7 ("memblock: make memblock_find_in_range method private")
invokes a kernel panic while running kmemleak on OF platforms with nomaped

  Unable to handle kernel paging request at virtual address fff000021e00000

Indeed, NOMAP regions don't have linear map entries so an attempt to scan
these areas would fault.

Prevent such faults by excluding NOMAP regions from kmemleak.

Fixes: a7259df7

 ("memblock: make memblock_find_in_range method private")
Signed-off-by: default avatarMike Rapoport <>
Tested-by: default avatarVladimir Zapolskiy <>
parent 64570fbc
......@@ -936,7 +936,12 @@ int __init_memblock memblock_mark_mirror(phys_addr_t base, phys_addr_t size)
int __init_memblock memblock_mark_nomap(phys_addr_t base, phys_addr_t size)
return memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP);
int ret = memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP);
if (!ret)
kmemleak_free_part_phys(base, size);
return ret;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment