summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorBrice Goglin <brice@myri.com>2006-07-10 03:10:18 +0200
committerJeff Garzik <jeff@garzik.org>2006-07-12 23:44:11 +0200
commit4c2248cc57f83ce551511a6c1736383938dd9d1b (patch)
tree6de890dd8a3f7dd6456d45bb713f915b97264661 /drivers/net
parent[PATCH] Update smc91x driver with ARM Versatile board info (diff)
downloadlinux-4c2248cc57f83ce551511a6c1736383938dd9d1b.tar.xz
linux-4c2248cc57f83ce551511a6c1736383938dd9d1b.zip
[PATCH] myri10ge return value fix
Andrew Morton wrote: > All these functions return error codes, and we're not checking them. We > should. So there's a patch which marks all these things as __must_check, > which causes around 1,500 new warnings. > The following patch fixes such a warning in myri10ge. Check pci_enable_device() return value in myri10ge_resume(). Signed-off-by: Brice Goglin <brice@myri.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/myri10ge/myri10ge.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index ee1de971a712..07ca9480a6fe 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -2412,14 +2412,20 @@ static int myri10ge_resume(struct pci_dev *pdev)
return -EIO;
}
myri10ge_restore_state(mgp);
- pci_enable_device(pdev);
+
+ status = pci_enable_device(pdev);
+ if (status < 0) {
+ dev_err(&pdev->dev, "failed to enable device\n");
+ return -EIO;
+ }
+
pci_set_master(pdev);
status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED,
netdev->name, mgp);
if (status != 0) {
dev_err(&pdev->dev, "failed to allocate IRQ\n");
- goto abort_with_msi;
+ goto abort_with_enabled;
}
myri10ge_reset(mgp);
@@ -2438,7 +2444,8 @@ static int myri10ge_resume(struct pci_dev *pdev)
return 0;
-abort_with_msi:
+abort_with_enabled:
+ pci_disable_device(pdev);
return -EIO;
}