aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp_glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 0b7d23b4ad95..be12fbfcae10 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -994,14 +994,16 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)
994 994
995 /* 995 /*
996 * This bridge should have been registered as a hotplug function 996 * This bridge should have been registered as a hotplug function
997 * under its parent, so the context has to be there. If not, we 997 * under its parent, so the context should be there, unless the
998 * are in deep goo. 998 * parent is going to be handled by pciehp, in which case this
999 * bridge is not interesting to us either.
999 */ 1000 */
1000 mutex_lock(&acpiphp_context_lock); 1001 mutex_lock(&acpiphp_context_lock);
1001 context = acpiphp_get_context(handle); 1002 context = acpiphp_get_context(handle);
1002 if (WARN_ON(!context)) { 1003 if (!context) {
1003 mutex_unlock(&acpiphp_context_lock); 1004 mutex_unlock(&acpiphp_context_lock);
1004 put_device(&bus->dev); 1005 put_device(&bus->dev);
1006 pci_dev_put(bridge->pci_dev);
1005 kfree(bridge); 1007 kfree(bridge);
1006 return; 1008 return;
1007 } 1009 }