HID: elo: kill not flush the work
authorOliver Neukum <oneukum@suse.com>
Tue, 31 May 2016 12:48:15 +0000 (14:48 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 1 Jun 2016 12:08:17 +0000 (14:08 +0200)
Flushing a work that reschedules itself is not a sensible operation. It needs
to be killed. Failure to do so leads to a kernel panic in the timer code.

CC: stable@vger.kernel.org
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-elo.c

index aad8c162a825dc60516700b1bd8caf8efeec4244..0cd4f72162394b5652fc529681cfbc8774b50a36 100644 (file)
@@ -261,7 +261,7 @@ static void elo_remove(struct hid_device *hdev)
        struct elo_priv *priv = hid_get_drvdata(hdev);
 
        hid_hw_stop(hdev);
-       flush_workqueue(wq);
+       cancel_delayed_work_sync(&priv->work);
        kfree(priv);
 }