summaryrefslogtreecommitdiffstats
path: root/drivers/net/r6040.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-01-04 23:40:04 +0100
committerDavid S. Miller <davem@davemloft.net>2011-01-06 20:18:07 +0100
commit9c86c0f4ba49b39f909d7f18731b91e563e07065 (patch)
tree70a179d53210068875525163f3350f7665bb9dae /drivers/net/r6040.c
parentdcb: use after free in dcb_flushapp() (diff)
downloadlinux-9c86c0f4ba49b39f909d7f18731b91e563e07065.tar.xz
linux-9c86c0f4ba49b39f909d7f18731b91e563e07065.zip
net: r6040: Return proper error for r6040_init_one
Return -ENOMEM instead of 0 for the case of mdiobus_alloc and kmalloc failure. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r--drivers/net/r6040.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 0b014c894686..27e6f6d43cac 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -1153,6 +1153,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
lp->mii_bus = mdiobus_alloc();
if (!lp->mii_bus) {
dev_err(&pdev->dev, "mdiobus_alloc() failed\n");
+ err = -ENOMEM;
goto err_out_unmap;
}
@@ -1165,6 +1166,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
if (!lp->mii_bus->irq) {
dev_err(&pdev->dev, "mii_bus irq allocation failed\n");
+ err = -ENOMEM;
goto err_out_mdio;
}