summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ti/cpmac.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-07-19 15:37:53 +0300
committerDavid S. Miller <davem@davemloft.net>2016-07-21 00:46:01 +0300
commit09714275b1ce7877f318bbd6321da1def95697d7 (patch)
tree4275ce363952e2c26bdbf245e9de396cc97252ed /drivers/net/ethernet/ti/cpmac.c
parent44fafdaa757cf251aade6c071f772ddb4e8a9885 (diff)
downloadlinux-09714275b1ce7877f318bbd6321da1def95697d7.tar.xz
net: cpmac: fix error handling of cpmac_probe()
Add the missing free_netdev() before return from function cpmac_probe() in the error handling case. This patch revert commit 0465be8f4f1d ("net: cpmac: fix in releasing resources"), which changed to only free_netdev while register_netdev failed. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpmac.c')
-rw-r--r--drivers/net/ethernet/ti/cpmac.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index 29f381b16a44..d300d536d06f 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -1119,7 +1119,7 @@ static int cpmac_probe(struct platform_device *pdev)
mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
if (!mem) {
rc = -ENODEV;
- goto out;
+ goto fail;
}
dev->irq = platform_get_irq_byname(pdev, "irq");
@@ -1147,7 +1147,7 @@ static int cpmac_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Could not attach to PHY\n");
rc = PTR_ERR(phydev);
- goto out;
+ goto fail;
}
rc = register_netdev(dev);
@@ -1166,7 +1166,6 @@ static int cpmac_probe(struct platform_device *pdev)
fail:
free_netdev(dev);
-out:
return rc;
}