Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0465be8f authored by Varka Bhadram's avatar Varka Bhadram Committed by David S. Miller
Browse files

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: default avatarVarka Bhadram <varkab@cdac.in>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 55064efd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1142,7 +1142,7 @@ static int cpmac_probe(struct platform_device *pdev)
	mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
	if (!mem) {
		rc = -ENODEV;
		goto fail;
		goto out;
	}

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

		rc = PTR_ERR(priv->phy);
		goto fail;
		goto out;
	}

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

fail:
	free_netdev(dev);
out:
	return rc;
}