projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a8fe00
)
net: r6040: Return proper error for r6040_init_one
author
Axel Lin
<
[email protected]
>
Tue, 4 Jan 2011 22:40:04 +0000
(22:40 +0000)
committer
David S. Miller
<
[email protected]
>
Thu, 6 Jan 2011 19:18:07 +0000
(11:18 -0800)
Return -ENOMEM instead of 0 for the case of mdiobus_alloc and kmalloc failure.
Signed-off-by: Axel Lin <
[email protected]
>
Acked-by: Florian Fainelli <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/r6040.c
patch
|
blob
|
history
diff --git
a/drivers/net/r6040.c
b/drivers/net/r6040.c
index 0b014c894686b06921d4fa4fa31321fdb0d1412e..27e6f6d43cac9be4ef52e1c011e8bfa5752404c9 100644
(file)
--- 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;
}