[PATCH] PCIE: cleanup on probe error

From: Randy.Dunlap
Date: Fri Jul 07 2006 - 00:31:33 EST


From: Randy Dunlap <rdunlap@xxxxxxxxxxxx>

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@xxxxxxxxxxxx>
---
drivers/pci/pcie/portdrv_pci.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)

--- linux-2618-rc1.orig/drivers/pci/pcie/portdrv_pci.c
+++ linux-2618-rc1/drivers/pci/pcie/portdrv_pci.c
@@ -73,8 +73,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;
}


---
-
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/