mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()
@ 2026-09-15  7:01 Wentao Liang
  2026-09-16 17:25 ` Linus Walleij
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wentao Liang @ 2026-09-15  7:01 UTC (permalink / raw)
  To: bmasney
  Cc: linusw, linux-arm-kernel, linux-clk, linux-kernel, mturquette,
	sboyd, Wentao Liang, stable

of_get_parent() takes a reference on the syscon parent node. The
reference is intentionally kept on the success path, but the error paths
return without dropping it, leaking the node reference. Release the
reference before returning on the error paths.

Fixes: d430819d69a5 ("clk: versatile-icst: add device tree support")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/clk/versatile/clk-icst.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
index 6bd3db54dd22..8c84377f3ec1 100644
--- a/drivers/clk/versatile/clk-icst.c
+++ b/drivers/clk/versatile/clk-icst.c
@@ -516,16 +516,19 @@ static void __init of_syscon_icst_setup(struct device_node *np)
 	map = syscon_node_to_regmap(parent);
 	if (IS_ERR(map)) {
 		pr_err("no regmap for syscon ICST clock parent\n");
+		of_node_put(parent);
 		return;
 	}
 
 	if (of_property_read_u32(np, "reg", &icst_desc.vco_offset) &&
 	    of_property_read_u32(np, "vco-offset", &icst_desc.vco_offset)) {
 		pr_err("no VCO register offset for ICST clock\n");
+		of_node_put(parent);
 		return;
 	}
 	if (of_property_read_u32(np, "lock-offset", &icst_desc.lock_offset)) {
 		pr_err("no lock register offset for ICST clock\n");
+		of_node_put(parent);
 		return;
 	}
 
@@ -552,6 +555,7 @@ static void __init of_syscon_icst_setup(struct device_node *np)
 		ctype = ICST_INTEGRATOR_CP_CM_MEM;
 	} else {
 		pr_err("unknown ICST clock %pOF\n", np);
+		of_node_put(parent);
 		return;
 	}
 
-- 
2.34.1


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

* Re: [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()
  2026-09-15  7:01 [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup() Wentao Liang
@ 2026-09-16 17:25 ` Linus Walleij
  2026-09-18 22:27   ` Brian Masney
  2026-09-18 22:28 ` Brian Masney
  2026-09-21 15:13 ` krzk
  2 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2026-09-16 17:25 UTC (permalink / raw)
  To: Wentao Liang
  Cc: bmasney, linux-arm-kernel, linux-clk, linux-kernel, mturquette,
	sboyd, stable

On Tue, Sep 15, 2026 at 9:01 AM Wentao Liang <vulab@iscas.ac.cn> wrote:

> of_get_parent() takes a reference on the syscon parent node. The
> reference is intentionally kept on the success path, but the error paths
> return without dropping it, leaking the node reference. Release the
> reference before returning on the error paths.
>
> Fixes: d430819d69a5 ("clk: versatile-icst: add device tree support")
> Cc: stable@vger.kernel.org

Stable? Really? It's no big deal.

> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>

Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

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

* Re: [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()
  2026-09-16 17:25 ` Linus Walleij
@ 2026-09-18 22:27   ` Brian Masney
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Masney @ 2026-09-18 22:27 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Wentao Liang, linux-arm-kernel, linux-clk, linux-kernel,
	mturquette, sboyd, stable

On Wed, Sep 16, 2026 at 07:25:39PM +0200, Linus Walleij wrote:
> On Tue, Sep 15, 2026 at 9:01 AM Wentao Liang <vulab@iscas.ac.cn> wrote:
> 
> > of_get_parent() takes a reference on the syscon parent node. The
> > reference is intentionally kept on the success path, but the error paths
> > return without dropping it, leaking the node reference. Release the
> > reference before returning on the error paths.
> >
> > Fixes: d430819d69a5 ("clk: versatile-icst: add device tree support")
> > Cc: stable@vger.kernel.org
> 
> Stable? Really? It's no big deal.

I'll pick this up but I'm going to drop the stable tag. It'll probably
end up there anyways with the Fixes tag.

Brian


> 
> > Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> 
> Reviewed-by: Linus Walleij <linusw@kernel.org>
> 
> Yours,
> Linus Walleij


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

* Re: [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()
  2026-09-15  7:01 [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup() Wentao Liang
  2026-09-16 17:25 ` Linus Walleij
@ 2026-09-18 22:28 ` Brian Masney
  2026-09-21 15:13 ` krzk
  2 siblings, 0 replies; 5+ messages in thread
From: Brian Masney @ 2026-09-18 22:28 UTC (permalink / raw)
  To: Wentao Liang
  Cc: linusw, linux-arm-kernel, linux-clk, linux-kernel, mturquette,
	sboyd, stable


On Tue, 15 Sep 2026 07:01:03 +0000, Wentao Liang wrote:
> clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()

Applied, thanks!

[1/1] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()
      commit: c90a50d07f0c38c62ce13a60806ab5e3b841f70f

Best regards,
-- 
Brian Masney <bmasney@redhat.com>


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

* Re: [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()
  2026-09-15  7:01 [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup() Wentao Liang
  2026-09-16 17:25 ` Linus Walleij
  2026-09-18 22:28 ` Brian Masney
@ 2026-09-21 15:13 ` krzk
  2 siblings, 0 replies; 5+ messages in thread
From: krzk @ 2026-09-21 15:13 UTC (permalink / raw)
  To: Wentao Liang
  Cc: linusw, stable, sboyd, linux-clk, bmasney, linux-arm-kernel,
	linux-kernel, mturquette


On Tue, 15 Sep 2026 07:01:03 +0000, Wentao Liang wrote:
> of_get_parent() takes a reference on the syscon parent node. The
> reference is intentionally kept on the success path, but the error paths
> return without dropping it, leaking the node reference. Release the
> reference before returning on the error paths.
> 
> Fixes: d430819d69a5 ("clk: versatile-icst: add device tree support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/clk/versatile/clk-icst.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 


You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.

More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.

This is on the verge of hostile patch: bomb us with so many
contributions, we won't be able to handle them in efficient manner,
like responding ONCE to ask you to slow down.  Considering all this
is untested and LLM generated, I have even more doubts whether this
should be considered for review.

Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem, how to document usage of LLM and how what you should not
do if this was posted in a good faith.

Best regards,
Krzysztof




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

end of thread, other threads:[~2026-09-21 15:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15  7:01 [PATCH] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup() Wentao Liang
2026-09-16 17:25 ` Linus Walleij
2026-09-18 22:27   ` Brian Masney
2026-09-18 22:28 ` Brian Masney
2026-09-21 15:13 ` krzk

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

all inboxes | Powered by JetHome®