Input: synaptics-rmi4 - destroy F54 poller workqueue when removing
authorChuhong Yuan <hslester96@gmail.com>
Fri, 15 Nov 2019 19:32:36 +0000 (11:32 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 16:59:30 +0000 (17:59 +0100)
commit ba60cf9f78f0d7c8e73c7390608f7f818ee68aa0 upstream.

The driver forgets to destroy workqueue in remove() similarly to what is
done when probe() fails. Add a call to destroy_workqueue() to fix it.

Since unregistration will wait for the work to finish, we do not need to
cancel/flush the work instance in remove().

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191114023405.31477-1-hslester96@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/rmi4/rmi_f54.c

index 4e4406eae42dde6ac35cc2a5c952403f3d7d83a8..7f1959517ec0a2a6af58557b5b285f4dcbad6ef1 100644 (file)
@@ -747,6 +747,7 @@ static void rmi_f54_remove(struct rmi_function *fn)
 
        video_unregister_device(&f54->vdev);
        v4l2_device_unregister(&f54->v4l2);
+       destroy_workqueue(f54->workqueue);
 }
 
 struct rmi_function_handler rmi_f54_handler = {