summaryrefslogtreecommitdiff
path: root/drivers/char/tty_ldisc.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-06-16 17:00:40 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 12:01:15 -0700
commit52856ed732aeab5e8e0b7c9e2a7a3d31736218ab (patch)
treee88a29287846120b5943423bd76b9ace7d3426b3 /drivers/char/tty_ldisc.c
parent8d2ead743dd54dff1fe3d0f4933e5da8bfe07472 (diff)
ldisc: Make sure the ldisc isn't active when we close it
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/tty_ldisc.c')
-rw-r--r--drivers/char/tty_ldisc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
index 94b3e06d73ec..874c2486c034 100644
--- a/drivers/char/tty_ldisc.c
+++ b/drivers/char/tty_ldisc.c
@@ -793,6 +793,8 @@ void tty_ldisc_hangup(struct tty_struct *tty)
/* Avoid racing set_ldisc */
mutex_lock(&tty->ldisc_mutex);
/* Switch back to N_TTY */
+ tty_ldisc_halt(tty);
+ tty_ldisc_wait_idle(tty);
tty_ldisc_reinit(tty);
/* At this point we have a closed ldisc and we want to
reopen it. We could defer this to the next open but