dpaa_eth: cleanup after init_phy() failure
authorMadalin Bucur <madalin.bucur@nxp.com>
Wed, 4 Jan 2017 11:21:29 +0000 (13:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Jan 2017 18:45:08 +0000 (13:45 -0500)
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

index 624ba9058dc46bd369f7be872b040aee1e814696..77517aa3e8d99fa2a35a15523f12e65583dfda26 100644 (file)
@@ -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++) {
@@ -2314,6 +2315,7 @@ mac_start_failed:
        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;