|
@@ -764,6 +764,8 @@ static void tty_ldisc_kill(struct tty_struct *tty)
|
|
* Called during the final close of a tty/pty pair in order to shut down
|
|
* Called during the final close of a tty/pty pair in order to shut down
|
|
* the line discpline layer. On exit the ldisc assigned is N_TTY and the
|
|
* the line discpline layer. On exit the ldisc assigned is N_TTY and the
|
|
* ldisc has not been opened.
|
|
* ldisc has not been opened.
|
|
|
|
+ *
|
|
|
|
+ * Holding ldisc_sem write lock serializes tty->ldisc changes.
|
|
*/
|
|
*/
|
|
|
|
|
|
void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)
|
|
void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)
|
|
@@ -776,13 +778,9 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)
|
|
tty_ldisc_debug(tty, "closing ldisc: %p\n", tty->ldisc);
|
|
tty_ldisc_debug(tty, "closing ldisc: %p\n", tty->ldisc);
|
|
|
|
|
|
tty_ldisc_lock_pair(tty, o_tty);
|
|
tty_ldisc_lock_pair(tty, o_tty);
|
|
- tty_lock_pair(tty, o_tty);
|
|
|
|
-
|
|
|
|
tty_ldisc_kill(tty);
|
|
tty_ldisc_kill(tty);
|
|
if (o_tty)
|
|
if (o_tty)
|
|
tty_ldisc_kill(o_tty);
|
|
tty_ldisc_kill(o_tty);
|
|
-
|
|
|
|
- tty_unlock_pair(tty, o_tty);
|
|
|
|
tty_ldisc_unlock_pair(tty, o_tty);
|
|
tty_ldisc_unlock_pair(tty, o_tty);
|
|
|
|
|
|
/* And the memory resources remaining (buffers, termios) will be
|
|
/* And the memory resources remaining (buffers, termios) will be
|