* [PATCH v2] clk/samsung: fix parent clock refcount leak in exynos_clkout_probe
@ 2026-06-28 12:54 WenTao Liang
2026-06-28 15:00 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: WenTao Liang @ 2026-06-28 12:54 UTC (permalink / raw)
To: krzk, s.nawrocki, cw00.choi, mturquette, sboyd
Cc: alim.akhtar, bmasney, linux-samsung-soc, linux-clk,
linux-arm-kernel, linux-kernel, WenTao Liang, Greg KH, stable
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.
Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Fixes: 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to module driver")
Cc: stable@vger.kernel.org
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
---
Changes in v2:
- Fix patch format based on reviewer feedback
---
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..71724b56de69 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 < parent_count; ++i)
+ if (!IS_ERR(parents[i]))
+ clk_put(parents[i]);
+
return 0;
err_clk_unreg:
--
2.39.5 (Apple Git-154)
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] clk/samsung: fix parent clock refcount leak in exynos_clkout_probe
2026-06-28 12:54 [PATCH v2] clk/samsung: fix parent clock refcount leak in exynos_clkout_probe WenTao Liang
@ 2026-06-28 15:00 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2026-06-28 15:00 UTC (permalink / raw)
To: WenTao Liang, s.nawrocki, cw00.choi, mturquette, sboyd
Cc: alim.akhtar, bmasney, linux-samsung-soc, linux-clk,
linux-arm-kernel, linux-kernel, Greg KH, stable
On 28/06/2026 14:54, WenTao Liang wrote:
> 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.
>
> Suggested-by: Greg KH <gregkh@linuxfoundation.org>
What was suggested by Greg?
> Fixes: 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to module driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
> ---
> Changes in v2:
> - Fix patch format based on reviewer feedback
So what is happening here with LLM?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-28 15:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-28 12:54 [PATCH v2] clk/samsung: fix parent clock refcount leak in exynos_clkout_probe WenTao Liang
2026-06-28 15:00 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox