cpmac: do not leak struct net_device on phy_connect errors
Subsystems (2)
PATCH 1/1 cpmac: do not leak struct net_device on phy_connect errors
If the call to phy_connect fails, we will return directly instead of freeing the previously allocated struct net_device.
Signed-off-by Florian Fainelli <[email protected]>
---
drivers/net/cpmac.c +2 -1
@@ -1181,7 +1181,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)if (netif_msg_drv (priv))printk (KERN_ERR "%s: Could not attach to PHY\n" , dev->name); -return PTR_ERR (priv->phy); + rc =PTR_ERR (priv->phy); + goto fail; }if ((rc =register_netdev (dev))) {
Hi David,
Forgot to mention that this is relevant for -stable and current net-next-2.6. Thanks!
Quoted 20 lines · Fainelli
If the call to
phy_connectfails, we will return directly instead of freeing the previously allocated structnet_device.Signed-off-by Florian Fainelli <[email protected]>---
drivers/net/cpmac.c +2
-1@@ -1181,7 +1181,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev) if (netif_msg_drv(priv)) printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); -return PTR_ERR (priv->phy); + rc =PTR_ERR (priv->phy); + goto fail; }if ((rc =register_netdev (dev))) {
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Sun, 27 Jun 2010 19:05:24 +0200
Quoted 1 line
Forgot to mention that this is relevant for -stable and current net-next-2.6
I put it into net-2.6 and since you CC:'d stable it should show up there automatically.