Skip to content

Commit c943e13

Browse files
musicakcgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b33061f commit c943e13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/speakup/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,7 @@ static void __exit speakup_exit(void)
22742274
unregister_vt_notifier(&vt_notifier_block);
22752275
speakup_unregister_devsynth();
22762276
speakup_cancel_paste();
2277-
del_timer(&cursor_timer);
2277+
del_timer_sync(&cursor_timer);
22782278
kthread_stop(speakup_task);
22792279
speakup_task = NULL;
22802280
mutex_lock(&spk_mutex);

0 commit comments

Comments
 (0)