From rdunlap@xenotime.net Thu Jul 6 21:33:20 2006 Date: Thu, 6 Jul 2006 21:36:01 -0700 From: "Randy.Dunlap" Cc: linux-pci@atrey.karlin.mff.cuni.cz, akpm , gregkh Subject: PCIE: cleanup on probe error Message-Id: <20060706213601.b3358503.rdunlap@xenotime.net> From: Randy Dunlap 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 Signed-off-by: Greg Kroah-Hartman --- drivers/pci/pcie/portdrv_pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/pci/pcie/portdrv_pci.c +++ gregkh-2.6/drivers/pci/pcie/portdrv_pci.c @@ -56,8 +56,10 @@ static int __devinit pcie_portdrv_probe "%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; }