VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Mike Rapoport <rppt@linux.ibm.com> 2021-10-13 08:36:59 +0300 committer: Mike Rapoport <rppt@linux.ibm.com> 2021-10-13 08:36:59 +0300 commit: 6e44bd6d34d659c44cd8e7fc925c8a97f49b3c33 parent: 64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc
Commit Summary:
memblock: exclude NOMAP regions from kmemleak
Diffstat:
1 file changed, 4 insertions, 1 deletion
diff --git a/mm/memblock.c b/mm/memblock.c
index 184dcd2e5d99..5c3503c98b2f 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -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;
 }
 
 /**