netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
@ 2025-10-02 17:46 Erick Karanja
  2025-10-03  7:33 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Erick Karanja @ 2025-10-02 17:46 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: skhan, linux-kernel-mentees, david.hunter.linux, netdev,
	linux-kernel, Erick Karanja

Add missing of_node_put call to release device node tbi obtained
via for_each_child_of_node.

Fixes: afae5ad78b342 ("net/fsl_pq_mdio: streamline probing of MDIO nodes")

Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
---
 drivers/net/ethernet/freescale/fsl_pq_mdio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index 577f9b1780ad..de88776dd2a2 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -479,10 +479,12 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
 					"missing 'reg' property in node %pOF\n",
 					tbi);
 				err = -EBUSY;
+				of_node_put(tbi);
 				goto error;
 			}
 			set_tbipa(*prop, pdev,
 				  data->get_tbipa, priv->map, &res);
+			of_node_put(tbi);
 		}
 	}
 
-- 
2.43.0


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

* Re: [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
  2025-10-02 17:46 [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe Erick Karanja
@ 2025-10-03  7:33 ` Simon Horman
  2025-10-03  9:22   ` Simon Horman
  2025-10-03 16:32 ` Markus Elfring
  2025-10-06 18:30 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2025-10-03  7:33 UTC (permalink / raw)
  To: Erick Karanja
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, skhan,
	linux-kernel-mentees, david.hunter.linux, netdev, linux-kernel

On Thu, Oct 02, 2025 at 08:46:17PM +0300, Erick Karanja wrote:
> Add missing of_node_put call to release device node tbi obtained
> via for_each_child_of_node.
> 
> Fixes: afae5ad78b342 ("net/fsl_pq_mdio: streamline probing of MDIO nodes")

nit: no blank line here

Slightly more importantly, although the code you are changing
was added by the cited commit, I think that the bug existed before then.
I wonder if the fixes tag should be.

Fixes: daa26ea63c6f ("Merge branch 'octeontx2-fix-bitmap-leaks-in-pf-and-vf'")

> 
> Signed-off-by: Erick Karanja <karanja99erick@gmail.com>

One minor comment on process: as a fix for networking code, most likely this
should be targeted at the net tree. And that should be denoted in the
subject like this:

Subject: [PATCH net] ...

And if you do post an updated version, which is probably not strictly
necessary, please be sure to observe the 24h rule.

See: https://docs.kernel.org/process/maintainer-netdev.html

The code changes themselves look good to me. Thanks.

Reviewed-by: Simon Horman <horms@kernel.org>

...

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

* Re: [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
  2025-10-03  7:33 ` Simon Horman
@ 2025-10-03  9:22   ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2025-10-03  9:22 UTC (permalink / raw)
  To: Erick Karanja
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, skhan,
	linux-kernel-mentees, david.hunter.linux, netdev, linux-kernel

On Fri, Oct 03, 2025 at 08:33:24AM +0100, Simon Horman wrote:
> On Thu, Oct 02, 2025 at 08:46:17PM +0300, Erick Karanja wrote:
> > Add missing of_node_put call to release device node tbi obtained
> > via for_each_child_of_node.
> > 
> > Fixes: afae5ad78b342 ("net/fsl_pq_mdio: streamline probing of MDIO nodes")
> 
> nit: no blank line here
> 
> Slightly more importantly, although the code you are changing
> was added by the cited commit, I think that the bug existed before then.
> I wonder if the fixes tag should be.
> 
> Fixes: daa26ea63c6f ("Merge branch 'octeontx2-fix-bitmap-leaks-in-pf-and-vf'")

Sorry the above is obviously bogus.
I should have said:

Fixes: 1577ecef7666 ("netdev: Merge UCC and gianfar MDIO bus drivers")

> 
> > 
> > Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
> 
> One minor comment on process: as a fix for networking code, most likely this
> should be targeted at the net tree. And that should be denoted in the
> subject like this:
> 
> Subject: [PATCH net] ...
> 
> And if you do post an updated version, which is probably not strictly
> necessary, please be sure to observe the 24h rule.
> 
> See: https://docs.kernel.org/process/maintainer-netdev.html
> 
> The code changes themselves look good to me. Thanks.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>
> 
> ...
> 

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

* Re: [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
  2025-10-02 17:46 [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe Erick Karanja
  2025-10-03  7:33 ` Simon Horman
@ 2025-10-03 16:32 ` Markus Elfring
  2025-10-03 17:39   ` Erick Karanja
  2025-10-06 18:30 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2025-10-03 16:32 UTC (permalink / raw)
  To: Erick Karanja, netdev, linux-kernel-mentees
  Cc: LKML, Andrew Lunn, David Hunter, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Shuah Khan, Simon Horman

> Add missing of_node_put call to release device node tbi obtained
> via for_each_child_of_node.

Will it become helpful to append parentheses to function names?

Regards,
Markus

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

* Re: [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
  2025-10-03 16:32 ` Markus Elfring
@ 2025-10-03 17:39   ` Erick Karanja
  0 siblings, 0 replies; 6+ messages in thread
From: Erick Karanja @ 2025-10-03 17:39 UTC (permalink / raw)
  To: Markus Elfring, netdev, linux-kernel-mentees
  Cc: LKML, Andrew Lunn, David Hunter, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Shuah Khan, Simon Horman

On Fri, 2025-10-03 at 18:32 +0200, Markus Elfring wrote:
> > Add missing of_node_put call to release device node tbi obtained
> > via for_each_child_of_node.
> 
> Will it become helpful to append parentheses to function names?
Yes, it is necessary.
> 
> Regards,
> Markus


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

* Re: [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
  2025-10-02 17:46 [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe Erick Karanja
  2025-10-03  7:33 ` Simon Horman
  2025-10-03 16:32 ` Markus Elfring
@ 2025-10-06 18:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-06 18:30 UTC (permalink / raw)
  To: Erick Karanja
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, skhan,
	linux-kernel-mentees, david.hunter.linux, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  2 Oct 2025 20:46:17 +0300 you wrote:
> Add missing of_node_put call to release device node tbi obtained
> via for_each_child_of_node.
> 
> Fixes: afae5ad78b342 ("net/fsl_pq_mdio: streamline probing of MDIO nodes")
> 
> Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
> 
> [...]

Here is the summary with links:
  - net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
    https://git.kernel.org/netdev/net/c/521405cb54cd

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-10-06 18:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02 17:46 [PATCH] net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe Erick Karanja
2025-10-03  7:33 ` Simon Horman
2025-10-03  9:22   ` Simon Horman
2025-10-03 16:32 ` Markus Elfring
2025-10-03 17:39   ` Erick Karanja
2025-10-06 18:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).