isdn: replace del_timer by del_timer_sync
authorJulia Lawall <Julia.Lawall@lip6.fr>
Wed, 26 Mar 2014 21:33:39 +0000 (22:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Mar 2014 19:28:06 +0000 (15:28 -0400)
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>
drivers/isdn/act2000/module.c
drivers/isdn/i4l/isdn_common.c
drivers/isdn/sc/init.c

index b4147c0b14b79e40de0a0c613fce54fdffcc5976..c3a1b061838da5f5b42aee00f5087e1e11c87b71 100644 (file)
@@ -796,7 +796,7 @@ static void __exit act2000_exit(void)
        act2000_card *last;
        while (card) {
                unregister_card(card);
-               del_timer(&card->ptimer);
+               del_timer_sync(&card->ptimer);
                card = card->next;
        }
        card = cards;
index 130f216431541d2bd3259757e7765d929a91dc5a..9b856e1890d1ebc4f7c82ebb6b045357abe5324b 100644 (file)
@@ -2381,7 +2381,7 @@ static void __exit isdn_exit(void)
        }
        isdn_tty_exit();
        unregister_chrdev(ISDN_MAJOR, "isdn");
-       del_timer(&dev->timer);
+       del_timer_sync(&dev->timer);
        /* call vfree with interrupts enabled, else it will hang */
        vfree(dev);
        printk(KERN_NOTICE "ISDN-subsystem unloaded\n");
index 92acc81f844d161a7e47d9477c2e49e941929d58..d6f19b168e8a1a6101fd11dea5de140eed90dffb 100644 (file)
@@ -390,8 +390,8 @@ static void __exit sc_exit(void)
                /*
                 * kill the timers
                 */
-               del_timer(&(sc_adapter[i]->reset_timer));
-               del_timer(&(sc_adapter[i]->stat_timer));
+               del_timer_sync(&(sc_adapter[i]->reset_timer));
+               del_timer_sync(&(sc_adapter[i]->stat_timer));
 
                /*
                 * Tell I4L we're toast