Skip to content

Commit

Permalink
hp_accel: fix race in device removal
Browse files Browse the repository at this point in the history
The work queue has to be flushed after the device has been made
inaccessible.  The patch closes a window during which a work queue might
remain active after the device is removed and would then lead to ACPI
calls with undefined behavior.

Signed-off-by: Oliver Neukum <[email protected]>
Acked-by: Eric Piel <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Cc: Pavel Herrmann <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Oliver Neukum authored and torvalds committed May 12, 2010
1 parent a3ed2a1 commit 06efbeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/hp_accel.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
lis3lv02d_joystick_disable();
lis3lv02d_poweroff(&lis3_dev);

flush_work(&hpled_led.work);
led_classdev_unregister(&hpled_led.led_classdev);
flush_work(&hpled_led.work);

return lis3lv02d_remove_fs(&lis3_dev);
}
Expand Down

0 comments on commit 06efbeb

Please sign in to comment.