Skip to content

Commit 9d28f94

Browse files
nehebkuba-moo
authored andcommitted
net: thunder_bgx: add a missing of_node_put
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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3bc32fd commit 9d28f94

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

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

15051509
lmac++;

0 commit comments

Comments
 (0)