From: Oliver Neukum <oneukum@suse.com>
Date: Tue, 31 May 2016 12:48:15 +0000 (+0200)
Subject: HID: elo: kill not flush the work
X-Git-Tag: firefly_0821_release~176^2~4^2~37^2~94
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2d7a2ff18a99accba695b9208f36174a2983413a;p=firefly-linux-kernel-4.4.55.git

HID: elo: kill not flush the work

commit ed596a4a88bd161f868ccba078557ee7ede8a6ef upstream.

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.

Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

diff --git a/drivers/hid/hid-elo.c b/drivers/hid/hid-elo.c
index aad8c162a825..0cd4f7216239 100644
--- a/drivers/hid/hid-elo.c
+++ b/drivers/hid/hid-elo.c
@@ -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);
 }