[PATCH] fix: clk/samsung: exynos_clkout_probe: success path leaks parent clock references from of_clk_get_by_name

WenTao Liang vulab at iscas.ac.cn
Fri Jun 26 05:01:35 PDT 2026


of_clk_get_by_name() acquires clock references stored in the local
  parents[] array. All error paths correctly release these via the clks_put
  label, but the success path returns 0 without releasing the parent
  references. The references were only needed to obtain clock names for
  registration and are permanently leaked after probe completes.

Cc: stable at vger.kernel.org
Fixes: 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to module driver")
Signed-off-by: WenTao Liang <vulab at iscas.ac.cn>
---
 drivers/clk/samsung/clk-exynos-clkout.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c
index 5b21025338bd..ee3048d36040 100644
--- a/drivers/clk/samsung/clk-exynos-clkout.c
+++ b/drivers/clk/samsung/clk-exynos-clkout.c
@@ -190,6 +190,10 @@ static int exynos_clkout_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_clk_unreg;
 
+	for (i = 0; i < EXYNOS_CLKOUT_PARENTS; ++i)
+		if (!IS_ERR(parents[i]))
+			clk_put(parents[i]);
+
 	return 0;
 
 err_clk_unreg:
-- 
2.39.5 (Apple Git-154)




More information about the linux-arm-kernel mailing list