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

hsr: 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: David S. Miller <davem@davemloft.net>

authored by

Julia Lawall and committed by
David S. Miller
02f2d5a0 84275593

+1 -1
+1 -1
net/hsr/hsr_main.c
··· 459 459 static void __exit hsr_exit(void) 460 460 { 461 461 unregister_netdevice_notifier(&hsr_nb); 462 - del_timer(&prune_timer); 462 + del_timer_sync(&prune_timer); 463 463 hsr_netlink_exit(); 464 464 dev_remove_pack(&hsr_pt); 465 465 }