The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] clk: st: clkgen-pll: Add a cleaup in clkgen_c32_pll_setup()
@ 2026-01-07  9:22 Haoxiang Li
  2026-01-15  0:41 ` Brian Masney
  0 siblings, 1 reply; 2+ messages in thread
From: Haoxiang Li @ 2026-01-07  9:22 UTC (permalink / raw)
  To: mturquette, sboyd, bmasney; +Cc: linux-clk, linux-kernel, Haoxiang Li

Add a iounmap() to release the memory allocated by
clkgen_get_register_base().

Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
---
 drivers/clk/st/clkgen-pll.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
index c258ff87a171..cc1dd9523fb2 100644
--- a/drivers/clk/st/clkgen-pll.c
+++ b/drivers/clk/st/clkgen-pll.c
@@ -777,7 +777,7 @@ static void __init clkgen_c32_pll_setup(struct device_node *np,
 	clk = clkgen_pll_register(parent_name, datac->data, pll_base, pll_flags,
 				  np->name, datac->data->lock);
 	if (IS_ERR(clk))
-		return;
+		goto err_unmap;
 
 	pll_name = __clk_get_name(clk);
 
@@ -785,7 +785,7 @@ static void __init clkgen_c32_pll_setup(struct device_node *np,
 
 	clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
 	if (!clk_data)
-		return;
+		goto err_unmap;
 
 	clk_data->clk_num = num_odfs;
 	clk_data->clks = kcalloc(clk_data->clk_num, sizeof(struct clk *),
@@ -827,6 +827,9 @@ static void __init clkgen_c32_pll_setup(struct device_node *np,
 	kfree(pll_name);
 	kfree(clk_data->clks);
 	kfree(clk_data);
+err_unmap:
+	if (pll_base)
+		iounmap(pll_base);
 }
 static void __init clkgen_c32_pll0_setup(struct device_node *np)
 {
-- 
2.25.1


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

end of thread, other threads:[~2026-01-15  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07  9:22 [PATCH] clk: st: clkgen-pll: Add a cleaup in clkgen_c32_pll_setup() Haoxiang Li
2026-01-15  0:41 ` Brian Masney

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