ACPI / scan: Clear match_driver flag in acpi_bus_trim()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 Jan 2014 22:08:09 +0000 (23:08 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 29 Jan 2014 10:40:43 +0000 (11:40 +0100)
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: 202317a573b2 (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>
drivers/acpi/scan.c

index c0f57ff..089dc40 100644 (file)
@@ -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);