projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b93742
)
TTY: pdc_cons, fix racy tty test
author
Jiri Slaby
<
[email protected]
>
Mon, 5 Mar 2012 13:52:50 +0000
(14:52 +0100)
committer
Greg Kroah-Hartman
<
[email protected]
>
Thu, 8 Mar 2012 20:51:13 +0000
(12:51 -0800)
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: Jiri Slaby <
[email protected]
>
Cc: Kyle McMartin <
[email protected]
>
Cc: Helge Deller <
[email protected]
>
Cc: "James E.J. Bottomley" <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
arch/parisc/kernel/pdc_cons.c
patch
|
blob
|
history
diff --git
a/arch/parisc/kernel/pdc_cons.c
b/arch/parisc/kernel/pdc_cons.c
index fc770be465ff648cb6e5d33dc883e1782531613a..c1db65fc4525faa0a23d31ccfce1b08fcd10b4b9 100644
(file)
--- a/
arch/parisc/kernel/pdc_cons.c
+++ b/
arch/parisc/kernel/pdc_cons.c
@@
-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);
}