Skip to content

Commit

Permalink
dpaa_eth: cleanup after init_phy() failure
Browse files Browse the repository at this point in the history
Signed-off-by: Madalin Bucur <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
madalinbucur authored and davem330 committed Jan 4, 2017
1 parent c030af8 commit 3fe61f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,8 @@ static int dpaa_open(struct net_device *net_dev)
net_dev->phydev = mac_dev->init_phy(net_dev, priv->mac_dev);
if (!net_dev->phydev) {
netif_err(priv, ifup, net_dev, "init_phy() failed\n");
return -ENODEV;
err = -ENODEV;
goto phy_init_failed;
}

for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) {
Expand All @@ -2314,6 +2315,7 @@ static int dpaa_open(struct net_device *net_dev)
for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++)
fman_port_disable(mac_dev->port[i]);

phy_init_failed:
dpaa_eth_napi_disable(priv);

return err;
Expand Down

0 comments on commit 3fe61f0

Please sign in to comment.