提交 e380a81e 编写于 作者: J Jiri Slaby 提交者: Greg Kroah-Hartman

TTY: pdc_cons, fix racy tty test

The tty->count test in the timer was racy. Let's remove the test and
properly delete the timer and wait for the body to finish using _sync
version of del_timer.
Signed-off-by: NJiri Slaby <jslaby@suse.cz>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9b937421
......@@ -103,7 +103,7 @@ static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
static void pdc_console_tty_close(struct tty_struct *tty, struct file *filp)
{
if (!tty->count)
del_timer(&pdc_console_timer);
del_timer_sync(&pdc_console_timer);
}
static int pdc_console_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
......@@ -153,7 +153,7 @@ static void pdc_console_poll(unsigned long unused)
if (count)
tty_flip_buffer_push(tty);
if (tty->count && (pdc_cons.flags & CON_ENABLED))
if (pdc_cons.flags & CON_ENABLED)
mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册