net: thunder_bgx: add a missing of_node_put
Subsystems (3)
PATCH 1/1 net: thunder_bgx: add a missing of_node_put
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 <[email protected]>
--- .../net/ethernet/cavium/thunder/thunder_bgx.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/ethernet/cavium/thunder/thunder_bgx.c +11 -7
@@ -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++;
Signature · 1 line
2.51.0
Quoted 3 lines · Rosen Penev
phy_npneeds 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")
Quoted 1 line
Signed-off-by Rosen Penev <[email protected]>
Otherwise, LGTM.
Reviewed-by Simon Horman <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 7 lines · On Mon, 1 Sep 2025 14:30:18 -0700 you wrote:
phy_npneeds to get freed, just like the other child nodes.Fixes 5fc7cf179449 ("net: thunderx: Cleanup PHY probing code.")Signed-off-by Rosen Penev <[email protected]>--- .../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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html