diff options
| -rw-r--r-- | drivers/acpi/pci_root.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 0ac546d5e53f..5ff173066127 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
| @@ -646,6 +646,7 @@ static void handle_root_bridge_insertion(acpi_handle handle) | |||
| 646 | 646 | ||
| 647 | static void handle_root_bridge_removal(struct acpi_device *device) | 647 | static void handle_root_bridge_removal(struct acpi_device *device) |
| 648 | { | 648 | { |
| 649 | acpi_status status; | ||
| 649 | struct acpi_eject_event *ej_event; | 650 | struct acpi_eject_event *ej_event; |
| 650 | 651 | ||
| 651 | ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); | 652 | ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); |
| @@ -661,7 +662,9 @@ static void handle_root_bridge_removal(struct acpi_device *device) | |||
| 661 | ej_event->device = device; | 662 | ej_event->device = device; |
| 662 | ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; | 663 | ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; |
| 663 | 664 | ||
| 664 | acpi_bus_hot_remove_device(ej_event); | 665 | status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, ej_event); |
| 666 | if (ACPI_FAILURE(status)) | ||
| 667 | kfree(ej_event); | ||
| 665 | } | 668 | } |
| 666 | 669 | ||
| 667 | static void _handle_hotplug_event_root(struct work_struct *work) | 670 | static void _handle_hotplug_event_root(struct work_struct *work) |
| @@ -676,8 +679,9 @@ static void _handle_hotplug_event_root(struct work_struct *work) | |||
| 676 | handle = hp_work->handle; | 679 | handle = hp_work->handle; |
| 677 | type = hp_work->type; | 680 | type = hp_work->type; |
| 678 | 681 | ||
| 679 | root = acpi_pci_find_root(handle); | 682 | acpi_scan_lock_acquire(); |
| 680 | 683 | ||
| 684 | root = acpi_pci_find_root(handle); | ||
| 681 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); | 685 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); |
| 682 | 686 | ||
| 683 | switch (type) { | 687 | switch (type) { |
| @@ -711,6 +715,7 @@ static void _handle_hotplug_event_root(struct work_struct *work) | |||
| 711 | break; | 715 | break; |
| 712 | } | 716 | } |
| 713 | 717 | ||
| 718 | acpi_scan_lock_release(); | ||
| 714 | kfree(hp_work); /* allocated in handle_hotplug_event_bridge */ | 719 | kfree(hp_work); /* allocated in handle_hotplug_event_bridge */ |
| 715 | kfree(buffer.pointer); | 720 | kfree(buffer.pointer); |
| 716 | } | 721 | } |
