From e4fd1f4a6e05335d464fe003c164fea850a3b3f3 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 6 Jul 2006 21:36:01 -0700 Subject: [PATCH] PCIE: cleanup on probe error 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(-) diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index d0a37976faa6..478d0d28f7ad 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -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; } -- 2.20.1