[PATCH] clk: mvebu: ap-cpu-clk: fix refcount leak

Alexander A. Klimov grandmaster at al2klimov.de
Tue May 26 11:40:56 PDT 2026


Every value returned from of_clk_get() is supposed to be cleaned up
via clk_put() once not needed anymore.

Fixes: f756e362d938 ("clk: mvebu: add CPU clock driver for Armada 7K/8K")
Signed-off-by: Alexander A. Klimov <grandmaster at al2klimov.de>
---
 drivers/clk/mvebu/ap-cpu-clk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/mvebu/ap-cpu-clk.c b/drivers/clk/mvebu/ap-cpu-clk.c
index 1e44ace7d951..7721d5fe50bc 100644
--- a/drivers/clk/mvebu/ap-cpu-clk.c
+++ b/drivers/clk/mvebu/ap-cpu-clk.c
@@ -312,6 +312,7 @@ static int ap_cpu_clock_probe(struct platform_device *pdev)
 		}
 		parent_name =  __clk_get_name(parent);
 		clk_name[12] += cluster_index;
+		clk_put(parent);
 		ap_cpu_clk[cluster_index].clk_name =
 			ap_cp_unique_name(dev, np->parent, clk_name);
 		ap_cpu_clk[cluster_index].cluster = cluster_index;
-- 
2.54.0




More information about the linux-arm-kernel mailing list