Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52856ed7 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

ldisc: Make sure the ldisc isn't active when we close it

parent 8d2ead74
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -793,6 +793,8 @@ void tty_ldisc_hangup(struct tty_struct *tty)
		/* Avoid racing set_ldisc */
		/* Avoid racing set_ldisc */
		mutex_lock(&tty->ldisc_mutex);
		mutex_lock(&tty->ldisc_mutex);
		/* Switch back to N_TTY */
		/* Switch back to N_TTY */
		tty_ldisc_halt(tty);
		tty_ldisc_wait_idle(tty);
		tty_ldisc_reinit(tty);
		tty_ldisc_reinit(tty);
		/* At this point we have a closed ldisc and we want to
		/* At this point we have a closed ldisc and we want to
		   reopen it. We could defer this to the next open but
		   reopen it. We could defer this to the next open but