]> err.no Git - linux-2.6/commitdiff
[PATCH] scx200_acb: handle PCI errors
authorJeff Garzik <jeff@garzik.org>
Sun, 19 Nov 2006 06:19:39 +0000 (22:19 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Mon, 20 Nov 2006 17:42:05 +0000 (09:42 -0800)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/i2c/busses/scx200_acb.c

index 32aab0d34ee930eb3b9a6f0a95fa752c7f32b7d9..714bae780953c821792ec410597411f722c7df87 100644 (file)
@@ -494,11 +494,12 @@ static __init int scx200_create_pci(const char *text, struct pci_dev *pdev,
        iface->pdev = pdev;
        iface->bar = bar;
 
-       pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+       rc = pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+       if (rc)
+               goto errout_free;
 
        rc = pci_request_region(iface->pdev, iface->bar, iface->adapter.name);
-
-       if (rc != 0) {
+       if (rc) {
                printk(KERN_ERR NAME ": can't allocate PCI BAR %d\n",
                                iface->bar);
                goto errout_free;