linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: thunder_bgx: add a missing of_node_put
@ 2025-09-01 21:30 Rosen Penev
  2025-09-02  9:41 ` Simon Horman
  2025-09-04  0:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2025-09-01 21:30 UTC (permalink / raw)
  To: netdev
  Cc: Sunil Goutham, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, David Daney,
	moderated list:ARM/CAVIUM THUNDER NETWORK DRIVER, open list

phy_np needs to get freed, just like the other child nodes.

Fixes: 5fc7cf179449 ("net: thunderx: Cleanup PHY probing code.")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 .../net/ethernet/cavium/thunder/thunder_bgx.c  | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 90c718af06c1..9efb60842ad1 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1493,13 +1493,17 @@ static int bgx_init_of_phy(struct bgx *bgx)
 		 * this cortina phy, for which there is no driver
 		 * support, ignore it.
 		 */
-		if (phy_np &&
-		    !of_device_is_compatible(phy_np, "cortina,cs4223-slice")) {
-			/* Wait until the phy drivers are available */
-			pd = of_phy_find_device(phy_np);
-			if (!pd)
-				goto defer;
-			bgx->lmac[lmac].phydev = pd;
+		if (phy_np) {
+			if (!of_device_is_compatible(phy_np, "cortina,cs4223-slice")) {
+				/* Wait until the phy drivers are available */
+				pd = of_phy_find_device(phy_np);
+				if (!pd) {
+					of_node_put(phy_np);
+					goto defer;
+				}
+				bgx->lmac[lmac].phydev = pd;
+			}
+			of_node_put(phy_np);
 		}
 
 		lmac++;
-- 
2.51.0


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

* Re: [PATCH] net: thunder_bgx: add a missing of_node_put
  2025-09-01 21:30 [PATCH] net: thunder_bgx: add a missing of_node_put Rosen Penev
@ 2025-09-02  9:41 ` Simon Horman
  2025-09-04  0:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-09-02  9:41 UTC (permalink / raw)
  To: Rosen Penev
  Cc: netdev, Sunil Goutham, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, David Daney,
	moderated list:ARM/CAVIUM THUNDER NETWORK DRIVER, open list

On Mon, Sep 01, 2025 at 02:30:18PM -0700, Rosen Penev wrote:
> phy_np needs to get freed, just like the other child nodes.
> 
> Fixes: 5fc7cf179449 ("net: thunderx: Cleanup PHY probing code.")

I wonder if this leak has existed since commit 4863dea3fab0 ("net: Adding
support for Cavium ThunderX network controller")

> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Otherwise, LGTM.

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

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

* Re: [PATCH] net: thunder_bgx: add a missing of_node_put
  2025-09-01 21:30 [PATCH] net: thunder_bgx: add a missing of_node_put Rosen Penev
  2025-09-02  9:41 ` Simon Horman
@ 2025-09-04  0:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-04  0:00 UTC (permalink / raw)
  To: Rosen Penev
  Cc: netdev, sgoutham, andrew+netdev, davem, edumazet, kuba, pabeni,
	david.daney, linux-arm-kernel, linux-kernel

Hello:

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

On Mon,  1 Sep 2025 14:30:18 -0700 you wrote:
> phy_np needs to get freed, just like the other child nodes.
> 
> Fixes: 5fc7cf179449 ("net: thunderx: Cleanup PHY probing code.")
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  .../net/ethernet/cavium/thunder/thunder_bgx.c  | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)

Here is the summary with links:
  - net: thunder_bgx: add a missing of_node_put
    https://git.kernel.org/netdev/net/c/9d28f9491258

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] 3+ messages in thread

end of thread, other threads:[~2025-09-04  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 21:30 [PATCH] net: thunder_bgx: add a missing of_node_put Rosen Penev
2025-09-02  9:41 ` Simon Horman
2025-09-04  0:00 ` 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).