• Rafael J. Wysocki's avatar
    ACPI / dock: Take ACPI scan lock in write_undock() · 8112006f
    Rafael J. Wysocki authored
    Since commit 3757b948 (ACPI / hotplug: Fix concurrency issues and
    memory leaks) acpi_bus_scan() and acpi_bus_trim() must always be
    called under acpi_scan_lock, but currently the following scenario
    violating that requirement is possible:
    
     write_undock()
      handle_eject_request()
       hotplug_dock_devices()
        dock_remove_acpi_device()
         acpi_bus_trim()
    
    Fix that by making write_undock() acquire acpi_scan_lock before
    calling handle_eject_request() as appropriate (begin_undock() is
    under the lock too in analogy with acpi_dock_deferred_cb()).
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Cc: 3.9+ <stable@vger.kernel.org>
    Acked-by: default avatarToshi Kani <toshi.kani@hp.com>
    8112006f
dock.c 27.4 KB