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>
This commit is contained in:
Alan Cox 2009-06-16 17:00:40 +01:00 committed by Linus Torvalds
parent 8d2ead743d
commit 52856ed732
1 changed files with 2 additions and 0 deletions

View File

@ -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