Commit c251ae0d authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] Char: moxa, use del_timer_sync

Use del_timer_sync in most timer deletions, we don't want to oops in the timer
function.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 11324edd
...@@ -424,10 +424,10 @@ static void __exit moxa_exit(void) ...@@ -424,10 +424,10 @@ static void __exit moxa_exit(void)
if (verbose) if (verbose)
printk("Unloading module moxa ...\n"); printk("Unloading module moxa ...\n");
del_timer(&moxaTimer); del_timer_sync(&moxaTimer);
for (i = 0; i < MAX_PORTS; i++) for (i = 0; i < MAX_PORTS; i++)
del_timer(&moxaEmptyTimer[i]); del_timer_sync(&moxaEmptyTimer[i]);
if (tty_unregister_driver(moxaDriver)) if (tty_unregister_driver(moxaDriver))
printk("Couldn't unregister MOXA Intellio family serial driver\n"); printk("Couldn't unregister MOXA Intellio family serial driver\n");
...@@ -529,7 +529,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp) ...@@ -529,7 +529,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
if (ch->asyncflags & ASYNC_INITIALIZED) { if (ch->asyncflags & ASYNC_INITIALIZED) {
setup_empty_event(tty); setup_empty_event(tty);
tty_wait_until_sent(tty, 30 * HZ); /* 30 seconds timeout */ tty_wait_until_sent(tty, 30 * HZ); /* 30 seconds timeout */
del_timer(&moxaEmptyTimer[ch->port]); del_timer_sync(&moxaEmptyTimer[ch->port]);
} }
shut_down(ch); shut_down(ch);
MoxaPortFlushData(port, 2); MoxaPortFlushData(port, 2);
...@@ -1004,7 +1004,7 @@ static void check_xmit_empty(unsigned long data) ...@@ -1004,7 +1004,7 @@ static void check_xmit_empty(unsigned long data)
struct moxa_str *ch; struct moxa_str *ch;
ch = (struct moxa_str *) data; ch = (struct moxa_str *) data;
del_timer(&moxaEmptyTimer[ch->port]); del_timer_sync(&moxaEmptyTimer[ch->port]);
if (ch->tty && (ch->statusflags & EMPTYWAIT)) { if (ch->tty && (ch->statusflags & EMPTYWAIT)) {
if (MoxaPortTxQueue(ch->port) == 0) { if (MoxaPortTxQueue(ch->port) == 0) {
ch->statusflags &= ~EMPTYWAIT; ch->statusflags &= ~EMPTYWAIT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment