Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH] fix: clk/samsung: exynos_clkout_probe: success path leaks parent clock   references from of_clk_get_by_name
@ 2026-06-26 12:01 WenTao Liang
  2026-06-26 14:24 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: WenTao Liang @ 2026-06-26 12:01 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, 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.

Cc: stable@vger.kernel.org
Fixes: 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to module driver")
Signed-off-by: WenTao Liang <vulab@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)


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

* Re: [PATCH] fix: clk/samsung: exynos_clkout_probe: success path leaks parent clock   references from of_clk_get_by_name
  2026-06-26 12:01 [PATCH] fix: clk/samsung: exynos_clkout_probe: success path leaks parent clock references from of_clk_get_by_name WenTao Liang
@ 2026-06-26 14:24 ` Greg KH
  2026-06-27 11:42   ` WenTao Liang
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2026-06-26 14:24 UTC (permalink / raw)
  To: WenTao Liang
  Cc: krzk, s.nawrocki, cw00.choi, mturquette, sboyd, alim.akhtar,
	bmasney, linux-samsung-soc, linux-clk, linux-arm-kernel,
	linux-kernel, stable

On Fri, Jun 26, 2026 at 08:01:35PM +0800, 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.
> 
> Cc: stable@vger.kernel.org
> Fixes: 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to module driver")
> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/clk/samsung/clk-exynos-clkout.c | 4 ++++
>  1 file changed, 4 insertions(+)

For all of these, you are not using the normal kernel style, which means
a LLM is generating them, which implies that you did not properly
document what tool found/fixed all of these.  So please go back and fix
them all up and resend them properly, after telling the
maintainers/developers that the originals should be ignored.

thanks,

greg k-h

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

* Re: [PATCH] fix: clk/samsung: exynos_clkout_probe: success path leaks parent clock   references from of_clk_get_by_name
  2026-06-26 14:24 ` Greg KH
@ 2026-06-27 11:42   ` WenTao Liang
  2026-06-27 17:26     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: WenTao Liang @ 2026-06-27 11:42 UTC (permalink / raw)
  To: Greg KH
  Cc: krzk, s.nawrocki, cw00.choi, mturquette, sboyd, alim.akhtar,
	bmasney, linux-samsung-soc, linux-clk, linux-arm-kernel,
	linux-kernel, stable



> 2026年6月26日 22:24,Greg KH <gregkh@linuxfoundation.org> 写道:
> 
> On Fri, Jun 26, 2026 at 08:01:35PM +0800, 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.
>> 
>> Cc: stable@vger.kernel.org
>> Fixes: 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to module driver")
>> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
>> ---
>> drivers/clk/samsung/clk-exynos-clkout.c | 4 ++++
>> 1 file changed, 4 insertions(+)
> 
> For all of these, you are not using the normal kernel style, which means
> a LLM is generating them, which implies that you did not properly
> document what tool found/fixed all of these.  So please go back and fix
> them all up and resend them properly, after telling the
> maintainers/developers that the originals should be ignored.
> 
> thanks,
> 
> greg k-h



Thank you for the review and guidance. I understand the issues now.

I will:
1. Study the proper kernel coding style
2. If using any automated tools, document them properly in the commit
   message
3. Fix all the patches following the correct style
4. Send a v2 series with proper version history
5. Inform all maintainers that the original patches should be ignored

I apologize for the inconvenience and will ensure future submissions
follow all kernel submission guidelines properly.

Regards,

WenTao Liang

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

* Re: [PATCH] fix: clk/samsung: exynos_clkout_probe: success path leaks parent clock   references from of_clk_get_by_name
  2026-06-27 11:42   ` WenTao Liang
@ 2026-06-27 17:26     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2026-06-27 17:26 UTC (permalink / raw)
  To: WenTao Liang
  Cc: krzk, s.nawrocki, cw00.choi, mturquette, sboyd, alim.akhtar,
	bmasney, linux-samsung-soc, linux-clk, linux-arm-kernel,
	linux-kernel, stable

On Sat, Jun 27, 2026 at 07:42:36PM +0800, WenTao Liang wrote:
> 
> 
> > 2026年6月26日 22:24,Greg KH <gregkh@linuxfoundation.org> 写道:
> > 
> > On Fri, Jun 26, 2026 at 08:01:35PM +0800, 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.
> >> 
> >> Cc: stable@vger.kernel.org
> >> Fixes: 9484f2cb8332 ("clk: samsung: exynos-clkout: convert to module driver")
> >> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
> >> ---
> >> drivers/clk/samsung/clk-exynos-clkout.c | 4 ++++
> >> 1 file changed, 4 insertions(+)
> > 
> > For all of these, you are not using the normal kernel style, which means
> > a LLM is generating them, which implies that you did not properly
> > document what tool found/fixed all of these.  So please go back and fix
> > them all up and resend them properly, after telling the
> > maintainers/developers that the originals should be ignored.
> > 
> > thanks,
> > 
> > greg k-h
> 
> 
> 
> Thank you for the review and guidance. I understand the issues now.
> 
> I will:
> 1. Study the proper kernel coding style
> 2. If using any automated tools, document them properly in the commit
>    message
> 3. Fix all the patches following the correct style
> 4. Send a v2 series with proper version history
> 5. Inform all maintainers that the original patches should be ignored

Do this right now please!

> I apologize for the inconvenience and will ensure future submissions
> follow all kernel submission guidelines properly.

Also try learning this by doing just a few patches first, not hundreds,
otherwise you run the risk of being outright banned from development.

good luck!

greg k-h

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

end of thread, other threads:[~2026-06-27 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 12:01 [PATCH] fix: clk/samsung: exynos_clkout_probe: success path leaks parent clock references from of_clk_get_by_name WenTao Liang
2026-06-26 14:24 ` Greg KH
2026-06-27 11:42   ` WenTao Liang
2026-06-27 17:26     ` Greg KH

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