Skip to content

Commit faae443

Browse files
committed
ACPI: bus: Ensure that notify handlers are not running after removal
Currently, acpi_device_remove_notify_handler() may return while the notify handler being removed is still running which may allow the module holding that handler to be torn down prematurely. Address this issue by making acpi_device_remove_notify_handler() wait for the handling of all the ACPI events in progress to complete before returning. Fixes: 5894b0c ("ACPI / scan: Move bus operations and notification routines to bus.c") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 6d572d3 commit faae443

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/acpi/bus.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ static void acpi_device_remove_notify_handler(struct acpi_device *device,
589589
acpi_remove_notify_handler(device->handle, type,
590590
acpi_notify_device);
591591
}
592+
acpi_os_wait_events_complete();
592593
}
593594

594595
/* Handle events targeting \_SB device (at present only graceful shutdown) */

0 commit comments

Comments
 (0)