]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
Merge tag 'fixes-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Oct 2021 17:57:13 +0000 (10:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Oct 2021 17:57:13 +0000 (10:57 -0700)
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

mm/memblock.c

index 184dcd2e5d9987a41315ebcf53d1dfa127e59913..5c3503c98b2f113ca3de1f0a76e863a316d5c8cd 100644 (file)
@@ -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;
 }
 
 /**