Skip to content

Commit

Permalink
ldisc: Make sure the ldisc isn't active when we close it
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Jun 16, 2009
1 parent 8d2ead7 commit 52856ed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/tty_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52856ed

Please sign in to comment.