]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
PCIE: cleanup on probe error
authorRandy Dunlap <rdunlap@xenotime.net>
Fri, 7 Jul 2006 04:36:01 +0000 (21:36 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 Aug 2006 20:20:06 +0000 (13:20 -0700)
If pcie_portdrv_probe() fails but it had already called
pci_enable_device(), then call pci_disable_device() when
returning error.

Is there some reason that this isn't being done?
or was it just missed?

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/pcie/portdrv_pci.c

index d0a37976faa6b4f6c87fd6a2263b4080baa642fa..478d0d28f7ad1e6b573e5e3c3a26f37b9dc1e557 100644 (file)
@@ -56,8 +56,10 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
                "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", 
                __FUNCTION__, dev->device, dev->vendor);
        }
-       if (pcie_port_device_register(dev)) 
+       if (pcie_port_device_register(dev)) {
+               pci_disable_device(dev);
                return -ENOMEM;
+       }
 
        return 0;
 }