mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 10:12:16 +09:00
ACPI / scan: Do not try to attach scan handlers to devices having them
commit 3a391a3959 upstream.
In acpi_bus_device_attach(), if there is an ACPI device object
for the given handle and that device object has a scan handler
attached to it already, there's nothing more to do for that handle.
Moreover, if acpi_scan_attach_handler() is called then, it may
execute the .attach() callback of the ACPI scan handler already
attached to the device object and that may lead to interesting
breakage.
For this reason, make acpi_bus_device_attach() return success
immediately when the handle's device object has a scan handler
attached to it.
Reported-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9d80c9e6f3
commit
85471df478
@@ -1892,6 +1892,9 @@ static acpi_status acpi_bus_device_attach(acpi_handle handle, u32 lvl_not_used,
|
||||
if (acpi_bus_get_device(handle, &device))
|
||||
return AE_CTRL_DEPTH;
|
||||
|
||||
if (device->handler)
|
||||
return AE_OK;
|
||||
|
||||
ret = acpi_scan_attach_handler(device);
|
||||
if (ret)
|
||||
return ret > 0 ? AE_OK : AE_CTRL_DEPTH;
|
||||
|
||||
Reference in New Issue
Block a user