aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarka Bhadram <varkab@cdac.in>2014-07-10 01:35:45 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-10 03:40:37 -0400
commit0465be8f4f1ddb251b25da26f1247581bcb98dbf (patch)
treef9d862d6f00984e82deb5c8eae412f21422a41db
parent55064efd24d094fc3cb767535a3c5890276ec0bc (diff)
net: cpmac: fix in releasing resources
before registering the the net device this code freeing net device by using the label 'fail' fixed by introducing an another label 'out' Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/ti/cpmac.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index b6efe3e0f1ee..b68c5b588742 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -1142,7 +1142,7 @@ static int cpmac_probe(struct platform_device *pdev)
1142 mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); 1142 mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
1143 if (!mem) { 1143 if (!mem) {
1144 rc = -ENODEV; 1144 rc = -ENODEV;
1145 goto fail; 1145 goto out;
1146 } 1146 }
1147 1147
1148 dev->irq = platform_get_irq_byname(pdev, "irq"); 1148 dev->irq = platform_get_irq_byname(pdev, "irq");
@@ -1170,7 +1170,7 @@ static int cpmac_probe(struct platform_device *pdev)
1170 dev_err(&pdev->dev, "Could not attach to PHY\n"); 1170 dev_err(&pdev->dev, "Could not attach to PHY\n");
1171 1171
1172 rc = PTR_ERR(priv->phy); 1172 rc = PTR_ERR(priv->phy);
1173 goto fail; 1173 goto out;
1174 } 1174 }
1175 1175
1176 rc = register_netdev(dev); 1176 rc = register_netdev(dev);
@@ -1189,6 +1189,7 @@ static int cpmac_probe(struct platform_device *pdev)
1189 1189
1190fail: 1190fail:
1191 free_netdev(dev); 1191 free_netdev(dev);
1192out:
1192 return rc; 1193 return rc;
1193} 1194}
1194 1195