Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: replace del_timer by del_timer_sync

Use del_timer_sync to ensure that the timer is stopped on all CPUs before
the driver exists.

This change was suggested by Thomas Gleixner.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
declarer name module_exit;
identifier ex;
@@

module_exit(ex);

@@
identifier r.ex;
@@

ex(...) {
<...
- del_timer
+ del_timer_sync
(...)
...>
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Julia Lawall and committed by
Greg Kroah-Hartman
0f1e126b 22766ed8

+1 -1
+1 -1
drivers/tty/serial/mux.c
··· 613 613 { 614 614 /* Delete the Mux timer. */ 615 615 if(port_cnt > 0) { 616 - del_timer(&mux_timer); 616 + del_timer_sync(&mux_timer); 617 617 #ifdef CONFIG_SERIAL_MUX_CONSOLE 618 618 unregister_console(&mux_console); 619 619 #endif