Skip to content

Commit

Permalink
ACPI / scan: Clear match_driver flag in acpi_bus_trim()
Browse files Browse the repository at this point in the history
Drivers should not bind to struct acpi_device objects that
acpi_bus_trim() has been called for, so make that function
clear flags.match_driver for those objects.

If that is not done, an ACPI driver may theoretically try to operate
a device that is not physically present.

Fixes: 202317a (ACPI / scan: Add acpi_device objects for all device nodes in the namespace)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
  • Loading branch information
Rafael J. Wysocki committed Jan 29, 2014
1 parent 00159a2 commit a951c77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,7 @@ void acpi_bus_trim(struct acpi_device *adev)
list_for_each_entry_reverse(child, &adev->children, node)
acpi_bus_trim(child);

adev->flags.match_driver = false;
if (handler) {
if (handler->detach)
handler->detach(adev);
Expand Down

0 comments on commit a951c77

Please sign in to comment.