From 9a4d8d60df3bc26236fa9cc3bc806ff99e5e5625 Mon Sep 17 00:00:00 2001 From: "Lee, Chun-Yi" Date: Fri, 30 Jun 2017 15:25:38 +0800 Subject: ACPI / bus: handle ACPI hotplug schedule errors completely Kernel should decrements the reference count of ACPI device when the scheduling of ACPI hotplug work failed, and evaluates _OST to notify BIOS the failure. Reviewed-by: Andy Shevchenko Signed-off-by: "Lee, Chun-Yi" Signed-off-by: Rafael J. Wysocki --- drivers/acpi/bus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 784bda663d16..9d4fea6433f5 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -432,11 +432,15 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS)) driver->ops.notify(adev, type); - if (hotplug_event && ACPI_SUCCESS(acpi_hotplug_schedule(adev, type))) + if (!hotplug_event) { + acpi_bus_put_acpi_device(adev); + return; + } + + if (ACPI_SUCCESS(acpi_hotplug_schedule(adev, type))) return; acpi_bus_put_acpi_device(adev); - return; err: acpi_evaluate_ost(handle, type, ost_code, NULL); -- cgit v1.2.3