summaryrefslogtreecommitdiffstats
path: root/drivers/staging/speakup/main.c
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla2016-03-06 02:15:07 +0100
committerGreg Kroah-Hartman2016-03-12 07:09:09 +0100
commitc943e13bd2bf4c344c3fe43ef39f07b57eff715e (patch)
treef0e98151b69e791ed9737c7055adf834d98f03a1 /drivers/staging/speakup/main.c
parentstaging: lowmemorykiller: fix 2 checks that checkpatch complained (diff)
downloadkernel-qcow2-linux-c943e13bd2bf4c344c3fe43ef39f07b57eff715e.tar.gz
kernel-qcow2-linux-c943e13bd2bf4c344c3fe43ef39f07b57eff715e.tar.xz
kernel-qcow2-linux-c943e13bd2bf4c344c3fe43ef39f07b57eff715e.zip
staging: speakup: Replace del_timer with del_timer_sync
Use del_timer_sync to ensure timer is stopped on all CPUs before the driver exists and the timer should not run when the module is being removed. Since the timer is not called from an interrupt context, this change is safe and will not cause deadlock. The Coccinelle semantic patch used to make this change is as follows: // <smpl> @r@ declarer name module_exit; identifier ex; @@ module_exit(ex); @@ identifier r.ex; @@ ex(...) { <... - del_timer + del_timer_sync (...) ...> } // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup/main.c')
-rw-r--r--drivers/staging/speakup/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index a87224c5510b..a22fb07512a1 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2274,7 +2274,7 @@ static void __exit speakup_exit(void)
unregister_vt_notifier(&vt_notifier_block);
speakup_unregister_devsynth();
speakup_cancel_paste();
- del_timer(&cursor_timer);
+ del_timer_sync(&cursor_timer);
kthread_stop(speakup_task);
speakup_task = NULL;
mutex_lock(&spk_mutex);