diff options
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 05e463db11de..8054ddcdaed0 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -340,6 +340,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data, | |||
340 | 340 | ||
341 | retval = acpiphp_register_hotplug_slot(slot, sun); | 341 | retval = acpiphp_register_hotplug_slot(slot, sun); |
342 | if (retval) { | 342 | if (retval) { |
343 | slot->slot = NULL; | ||
343 | bridge->nr_slots--; | 344 | bridge->nr_slots--; |
344 | if (retval == -EBUSY) | 345 | if (retval == -EBUSY) |
345 | warn("Slot %llu already registered by another " | 346 | warn("Slot %llu already registered by another " |
@@ -429,7 +430,8 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge) | |||
429 | err("failed to remove notify handler\n"); | 430 | err("failed to remove notify handler\n"); |
430 | } | 431 | } |
431 | } | 432 | } |
432 | acpiphp_unregister_hotplug_slot(slot); | 433 | if (slot->slot) |
434 | acpiphp_unregister_hotplug_slot(slot); | ||
433 | } | 435 | } |
434 | 436 | ||
435 | mutex_lock(&bridge_mutex); | 437 | mutex_lock(&bridge_mutex); |