Skip to content

Commit e209d33

Browse files
nehebopsiff
authored andcommitted
net: thunder_bgx: add a missing of_node_put
[ Upstream commit 9d28f94 ] phy_np needs to get freed, just like the other child nodes. Fixes: 5fc7cf1 ("net: thunderx: Cleanup PHY probing code.") Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250901213018.47392-1-rosenp@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 4535729550cf1ed91d9805a40aed64b942f5c132)
1 parent f60f945 commit e209d33

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

drivers/net/ethernet/cavium/thunder/thunder_bgx.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,13 +1491,17 @@ static int bgx_init_of_phy(struct bgx *bgx)
14911491
* this cortina phy, for which there is no driver
14921492
* support, ignore it.
14931493
*/
1494-
if (phy_np &&
1495-
!of_device_is_compatible(phy_np, "cortina,cs4223-slice")) {
1496-
/* Wait until the phy drivers are available */
1497-
pd = of_phy_find_device(phy_np);
1498-
if (!pd)
1499-
goto defer;
1500-
bgx->lmac[lmac].phydev = pd;
1494+
if (phy_np) {
1495+
if (!of_device_is_compatible(phy_np, "cortina,cs4223-slice")) {
1496+
/* Wait until the phy drivers are available */
1497+
pd = of_phy_find_device(phy_np);
1498+
if (!pd) {
1499+
of_node_put(phy_np);
1500+
goto defer;
1501+
}
1502+
bgx->lmac[lmac].phydev = pd;
1503+
}
1504+
of_node_put(phy_np);
15011505
}
15021506

15031507
lmac++;

0 commit comments

Comments
 (0)