Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06efbeb4 authored by Oliver Neukum's avatar Oliver Neukum Committed by Linus Torvalds
Browse files

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: default avatarOliver Neukum <oneukum@suse.de>
Acked-by: default avatarEric Piel <eric.piel@tremplin-utc.net>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Cc: Pavel Herrmann <morpheus.ibis@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a3ed2a15
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
}