Skip to content

Commit c9b895c

Browse files
liujian56kuba-moo
authored andcommitted
net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
If ag71xx_hw_enable() fails, call phylink_disconnect_phy() to clean up. And if phylink_of_phy_connect() fails, nothing needs to be done. Compile tested only. Fixes: 892e091 ("net: ag71xx: port to phylink") Signed-off-by: Liu Jian <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9d45921 commit c9b895c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/atheros/ag71xx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ static int ag71xx_open(struct net_device *ndev)
14271427
if (ret) {
14281428
netif_err(ag, link, ndev, "phylink_of_phy_connect filed with err: %i\n",
14291429
ret);
1430-
goto err;
1430+
return ret;
14311431
}
14321432

14331433
max_frame_len = ag71xx_max_frame_len(ndev->mtu);
@@ -1448,6 +1448,7 @@ static int ag71xx_open(struct net_device *ndev)
14481448

14491449
err:
14501450
ag71xx_rings_cleanup(ag);
1451+
phylink_disconnect_phy(ag->phylink);
14511452
return ret;
14521453
}
14531454

0 commit comments

Comments
 (0)