aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2010-05-11 17:07:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-11 20:33:42 -0400
commit06efbeb4a47b6f865e1c9d175ab9d6e90b69ae9e (patch)
tree6c25f5ff4a50ad3d42c93a17a13a278076d2b52a
parenta3ed2a15719219769bb095b28009c1d654a419e8 (diff)
hp_accel: fix race in device removal
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 <oneukum@suse.de> Acked-by: Eric Piel <eric.piel@tremplin-utc.net> Acked-by: Pavel Machek <pavel@ucw.cz> Cc: Pavel Herrmann <morpheus.ibis@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/hwmon/hp_accel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/hp_accel.c b/drivers/hwmon/hp_accel.c
index c8ab50516672..7580f55e67e3 100644
--- a/drivers/hwmon/hp_accel.c
+++ b/drivers/hwmon/hp_accel.c
@@ -328,8 +328,8 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
328 lis3lv02d_joystick_disable(); 328 lis3lv02d_joystick_disable();
329 lis3lv02d_poweroff(&lis3_dev); 329 lis3lv02d_poweroff(&lis3_dev);
330 330
331 flush_work(&hpled_led.work);
332 led_classdev_unregister(&hpled_led.led_classdev); 331 led_classdev_unregister(&hpled_led.led_classdev);
332 flush_work(&hpled_led.work);
333 333
334 return lis3lv02d_remove_fs(&lis3_dev); 334 return lis3lv02d_remove_fs(&lis3_dev);
335} 335}