Re: 2.6.18-rc1-mm1
- From: Brice Goglin <brice@xxxxxxxx>
- Date: Sun, 09 Jul 2006 21:10:18 -0400
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.
Hi Andrew,
The following patch fixes such a warning in myri10ge.
thanks,
Brice
Check pci_enable_device() return value in myri10ge_resume().
Signed-off-by: Brice Goglin <brice@xxxxxxxx>
---
drivers/net/myri10ge/myri10ge.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
Index: linux-mm/drivers/net/myri10ge/myri10ge.c
===================================================================
--- linux-mm.orig/drivers/net/myri10ge/myri10ge.c 2006-07-09 10:36:22.000000000 -0400
+++ linux-mm/drivers/net/myri10ge/myri10ge.c 2006-07-09 11:05:23.000000000 -0400
@@ -2412,14 +2412,20 @@
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 @@
return 0;
-abort_with_msi:
+abort_with_enabled:
+ pci_disable_device(pdev);
return -EIO;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- 2.6.18-rc1-mm1
- From: Andrew Morton
- 2.6.18-rc1-mm1
- Prev by Date: Re: [RFC 1/8] Add CONFIG_ZONE_DMA to all archesM
- Next by Date: Re: Magic Alt-SysRq change in 2.6.18-rc1
- Previous by thread: Re: 2.6.18-rc1-mm1
- Next by thread: Re: 2.6.18-rc1-mm1
- Index(es):
Relevant Pages
|
|