Skip to content

Commit 0465be8

Browse files
bhadramdavem330
authored andcommitted
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>
1 parent 55064ef commit 0465be8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/ti/cpmac.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ static int cpmac_probe(struct platform_device *pdev)
11421142
mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
11431143
if (!mem) {
11441144
rc = -ENODEV;
1145-
goto fail;
1145+
goto out;
11461146
}
11471147

11481148
dev->irq = platform_get_irq_byname(pdev, "irq");
@@ -1170,7 +1170,7 @@ static int cpmac_probe(struct platform_device *pdev)
11701170
dev_err(&pdev->dev, "Could not attach to PHY\n");
11711171

11721172
rc = PTR_ERR(priv->phy);
1173-
goto fail;
1173+
goto out;
11741174
}
11751175

11761176
rc = register_netdev(dev);
@@ -1189,6 +1189,7 @@ static int cpmac_probe(struct platform_device *pdev)
11891189

11901190
fail:
11911191
free_netdev(dev);
1192+
out:
11921193
return rc;
11931194
}
11941195

0 commit comments

Comments
 (0)