diff options
author | Brice Goglin <brice@myri.com> | 2006-07-09 21:10:18 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-07-12 17:44:11 -0400 |
commit | 4c2248cc57f83ce551511a6c1736383938dd9d1b (patch) | |
tree | 6de890dd8a3f7dd6456d45bb713f915b97264661 /drivers/net/myri10ge | |
parent | 8431adfd37c306c05abeac8879be7b4e03273a4f (diff) |
[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/myri10ge')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 13 |
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) | |||
2412 | return -EIO; | 2412 | return -EIO; |
2413 | } | 2413 | } |
2414 | myri10ge_restore_state(mgp); | 2414 | myri10ge_restore_state(mgp); |
2415 | pci_enable_device(pdev); | 2415 | |
2416 | status = pci_enable_device(pdev); | ||
2417 | if (status < 0) { | ||
2418 | dev_err(&pdev->dev, "failed to enable device\n"); | ||
2419 | return -EIO; | ||
2420 | } | ||
2421 | |||
2416 | pci_set_master(pdev); | 2422 | pci_set_master(pdev); |
2417 | 2423 | ||
2418 | status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED, | 2424 | status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED, |
2419 | netdev->name, mgp); | 2425 | netdev->name, mgp); |
2420 | if (status != 0) { | 2426 | if (status != 0) { |
2421 | dev_err(&pdev->dev, "failed to allocate IRQ\n"); | 2427 | dev_err(&pdev->dev, "failed to allocate IRQ\n"); |
2422 | goto abort_with_msi; | 2428 | goto abort_with_enabled; |
2423 | } | 2429 | } |
2424 | 2430 | ||
2425 | myri10ge_reset(mgp); | 2431 | myri10ge_reset(mgp); |
@@ -2438,7 +2444,8 @@ static int myri10ge_resume(struct pci_dev *pdev) | |||
2438 | 2444 | ||
2439 | return 0; | 2445 | return 0; |
2440 | 2446 | ||
2441 | abort_with_msi: | 2447 | abort_with_enabled: |
2448 | pci_disable_device(pdev); | ||
2442 | return -EIO; | 2449 | return -EIO; |
2443 | 2450 | ||
2444 | } | 2451 | } |