🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
4 messages
4 total messages Started by Haotian Zhang Thu, 08 Oct 2026 16:53
[PATCH] net: mvmdio: fix clk reference leak in orion_mdio_probe()
#793
Author: Haotian Zhang
Date: Thu, 08 Oct 2026 16:53
48 lines
7338 bytes
orion_mdio_probe() calls of_clk_get() with index ARRAY_SIZE(dev->clk)
purely to test whether the device tree declares more clocks than the
driver supports.  of_clk_get() takes a reference on the returned clk,
but the return value is only checked with IS_ERR() and never released,
so both the clk reference and the clk allocated by alloc_clk() are leaked
whenever the DT node has more than four clocks.

Store the returned clk in a local variable and release it with clk_put()
after emitting the warning.

Fixes: ea664b1bdc19 ("net: mvmdio: print warning when orion-mdio has too many clocks")
Assisted-by: DeepSeek-V4.1-Flash
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
 drivers/net/ethernet/marvell/mvmdio.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
index 2ccb8c8f5feb..17537142be6d 100644
--- a/drivers/net/ethernet/marvell/mvmdio.c
+++ b/drivers/net/ethernet/marvell/mvmdio.c
@@ -286,6 +286,7 @@ static int orion_mdio_probe(struct platform_device *pdev)
 	struct resource *r;
 	struct mii_bus *bus;
 	struct orion_mdio_dev *dev;
+	struct clk *clk;
 	int i, ret;
 
 	type = (uintptr_t)device_get_match_data(&pdev->dev);
@@ -338,11 +339,13 @@ static int orion_mdio_probe(struct platform_device *pdev)
 			clk_prepare_enable(dev->clk[i]);
 		}
 
-		if (!IS_ERR(of_clk_get(pdev->dev.of_node,
-				       ARRAY_SIZE(dev->clk))))
+		clk = of_clk_get(pdev->dev.of_node, ARRAY_SIZE(dev->clk));
+		if (!IS_ERR(clk)) {
 			dev_warn(&pdev->dev,
 				 "unsupported number of clocks, limiting to the first "
 				 __stringify(ARRAY_SIZE(dev->clk)) "\n");
+			clk_put(clk);
+		}
 
 		if (type == BUS_TYPE_XSMI)
 			orion_mdio_xsmi_set_mdc_freq(bus);
-- 
2.25.1
Re: [PATCH] net: mvmdio: fix clk reference leak in orion_mdio_probe()
#798
Author: netdev-bot+sinfo
Date: Thu, 08 Oct 2026 16:59
26 lines
6536 bytes
Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by code inspection). If it was triggered please include
   the symptoms, like the stack trace or error messages.

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.

The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
Re: [PATCH] net: mvmdio: fix clk reference leak in orion_mdio_probe()
#881
Author: Andrew Lunn
Date: Thu, 08 Oct 2026 19:20
19 lines
6350 bytes
On Fri, Oct 09, 2026 at 12:53:28AM +0800, Haotian Zhang wrote:
> orion_mdio_probe() calls of_clk_get() with index ARRAY_SIZE(dev->clk)
> purely to test whether the device tree declares more clocks than the
> driver supports.  of_clk_get() takes a reference on the returned clk,
> but the return value is only checked with IS_ERR() and never released,
> so both the clk reference and the clk allocated by alloc_clk() are leaked
> whenever the DT node has more than four clocks.
> 
> Store the returned clk in a local variable and release it with clk_put()
> after emitting the warning.

net-next.


    Andrew

---
pw-bot: cr
Re: [PATCH] net: mvmdio: fix clk reference leak in orion_mdio_probe()
#1076
Author: Krzysztof Kozlowski
Date: Fri, 09 Oct 2026 06:10
56 lines
7751 bytes
On Fri, 09 Oct 2026 00:53:28 +0800, Haotian Zhang wrote:
> orion_mdio_probe() calls of_clk_get() with index ARRAY_SIZE(dev->clk)
> purely to test whether the device tree declares more clocks than the
> driver supports.  of_clk_get() takes a reference on the returned clk,
> but the return value is only checked with IS_ERR() and never released,
> so both the clk reference and the clk allocated by alloc_clk() are leaked
> whenever the DT node has more than four clocks.
> 
> Store the returned clk in a local variable and release it with clk_put()
> after emitting the warning.
> 
> Fixes: ea664b1bdc19 ("net: mvmdio: print warning when orion-mdio has too many clocks")
> Assisted-by: DeepSeek-V4.1-Flash
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---
>  drivers/net/ethernet/marvell/mvmdio.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 



Multiple things here:
1. Your team ignored completely previous feedback.

2. You use multiple identities with this email, thus I actually doubt we speak
   with actual person.

3. Finally, same feedback:
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 (so a patchset grouping multiple patches with a short cover
letter), how to document usage of LLM and how what you should not do
if this was posted in a good faith.

Best regards,
Krzysztof
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads