[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230109221624.592315-2-isaacmanjarres@google.com>
Date: Mon, 9 Jan 2023 14:16:22 -0800
From: "Isaac J. Manjarres" <isaacmanjarres@...gle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Saravana Kannan <saravanak@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
"Isaac J. Manjarres" <isaacmanjarres@...gle.com>,
kernel-team@...roid.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: [PATCH v1 1/2] mm/cma.c: Make kmemleak aware of all CMA regions
Currently, kmemleak tracks CMA regions that are specified through the
devicetree. However, if the global CMA region is specified through
the commandline, kmemleak will be unaware of the CMA region because
kmemleak_alloc_phys() is not invoked after memblock_reserve(). Add
the missing call to kmemleak_alloc_phys() so that all CMA regions are
tracked by kmemleak before they are freed to the page allocator in
cma_activate_area().
Cc: stable@...r.kernel.org
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@...gle.com>
---
mm/cma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/cma.c b/mm/cma.c
index 4a978e09547a..674b7fdd563e 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -318,6 +318,8 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
ret = -EBUSY;
goto err;
}
+
+ kmemleak_alloc_phys(base, size, 0);
} else {
phys_addr_t addr = 0;
--
2.39.0.314.g84b9a713c41-goog
Powered by blists - more mailing lists