public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: mediatek: clk-mt8173: fix memory leak in clk_mt8173_apmixed_probe
@ 2023-04-25 13:26 Ziqin Liu
  2023-04-25 16:56 ` kernel test robot
  2023-04-28 20:17 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Ziqin Liu @ 2023-04-25 13:26 UTC (permalink / raw)
  To: dzm91, Michael Turquette, Stephen Boyd, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: hust-os-kernel-patches, Ziqin Liu, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek

'base' from of_iomap() is not released until the prode function returns,
a memory leak will occur in some case, so use devm_of_iomap() instead of
of_iomap() to automatically handle the unused ioremap region.

Fixes: 4c02c9af3cb9 ("clk: mediatek: mt8173: Break down clock drivers and allow module build")
Signed-off-by: Ziqin Liu <ziqin_l@hust.edu.cn>
---
 drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
index a56c5845d07a..f80de9e60b21 100644
--- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
+++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
@@ -90,7 +90,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
 	struct clk_hw *hw;
 	int r;
 
-	base = of_iomap(node, 0);
+	base = devm_of_iomap(pdev->dev, node, 0, NULL);
 	if (!base)
 		return PTR_ERR(base);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-28 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 13:26 [PATCH] clk: mediatek: clk-mt8173: fix memory leak in clk_mt8173_apmixed_probe Ziqin Liu
2023-04-25 16:56 ` kernel test robot
2023-04-28 20:17 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox