Skip to content

Commit

Permalink
[PATCH] myri10ge return value fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brice Goglin authored and Jeff Garzik committed Jul 12, 2006
1 parent 8431adf commit 4c2248c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

}
Expand Down

0 comments on commit 4c2248c

Please sign in to comment.