Skip to content

Commit

Permalink
[PATCH] Char: moxa, use del_timer_sync
Browse files Browse the repository at this point in the history
Use del_timer_sync in most timer deletions, we don't want to oops in the timer
function.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Feb 11, 2007
1 parent 11324ed commit c251ae0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/char/moxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,10 @@ static void __exit moxa_exit(void)
if (verbose)
printk("Unloading module moxa ...\n");

del_timer(&moxaTimer);
del_timer_sync(&moxaTimer);

for (i = 0; i < MAX_PORTS; i++)
del_timer(&moxaEmptyTimer[i]);
del_timer_sync(&moxaEmptyTimer[i]);

if (tty_unregister_driver(moxaDriver))
printk("Couldn't unregister MOXA Intellio family serial driver\n");
Expand Down Expand Up @@ -529,7 +529,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
if (ch->asyncflags & ASYNC_INITIALIZED) {
setup_empty_event(tty);
tty_wait_until_sent(tty, 30 * HZ); /* 30 seconds timeout */
del_timer(&moxaEmptyTimer[ch->port]);
del_timer_sync(&moxaEmptyTimer[ch->port]);
}
shut_down(ch);
MoxaPortFlushData(port, 2);
Expand Down Expand Up @@ -1004,7 +1004,7 @@ static void check_xmit_empty(unsigned long data)
struct moxa_str *ch;

ch = (struct moxa_str *) data;
del_timer(&moxaEmptyTimer[ch->port]);
del_timer_sync(&moxaEmptyTimer[ch->port]);
if (ch->tty && (ch->statusflags & EMPTYWAIT)) {
if (MoxaPortTxQueue(ch->port) == 0) {
ch->statusflags &= ~EMPTYWAIT;
Expand Down

0 comments on commit c251ae0

Please sign in to comment.