if (IS_ERR(priv->txchan)) {
                dev_err(&pdev->dev, "error initializing tx dma channel\n");
                rc = PTR_ERR(priv->txchan);
-               goto no_cpdma_chan;
+               goto err_free_dma;
        }
 
        priv->rxchan = cpdma_chan_create(priv->dma, EMAC_DEF_RX_CH,
        if (IS_ERR(priv->rxchan)) {
                dev_err(&pdev->dev, "error initializing rx dma channel\n");
                rc = PTR_ERR(priv->rxchan);
-               goto no_cpdma_chan;
+               goto err_free_txchan;
        }
 
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (!res) {
                dev_err(&pdev->dev, "error getting irq res\n");
                rc = -ENOENT;
-               goto no_cpdma_chan;
+               goto err_free_rxchan;
        }
        ndev->irq = res->start;
 
                pm_runtime_put_noidle(&pdev->dev);
                dev_err(&pdev->dev, "%s: failed to get_sync(%d)\n",
                        __func__, rc);
-               goto no_cpdma_chan;
+               goto err_napi_del;
        }
 
        /* register the network device */
                dev_err(&pdev->dev, "error in register_netdev\n");
                rc = -ENODEV;
                pm_runtime_put(&pdev->dev);
-               goto no_cpdma_chan;
+               goto err_napi_del;
        }
 
 
 
        return 0;
 
-no_cpdma_chan:
-       if (priv->txchan)
-               cpdma_chan_destroy(priv->txchan);
-       if (priv->rxchan)
-               cpdma_chan_destroy(priv->rxchan);
+err_napi_del:
+       netif_napi_del(&priv->napi);
+err_free_rxchan:
+       cpdma_chan_destroy(priv->rxchan);
+err_free_txchan:
+       cpdma_chan_destroy(priv->txchan);
+err_free_dma:
        cpdma_ctlr_destroy(priv->dma);
 no_pdata:
        if (of_phy_is_fixed_link(np))