Commit ccfb5ceb authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull memblock fix from Mike Rapoport:
 "Fix handling of NOMAP regions with kmemleak.

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

  Prevent such faults by excluding NOMAP regions from kmemleak"

* tag 'fixes-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
  memblock: exclude NOMAP regions from kmemleak
parents 368a978c 6e44bd6d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;
}

/**