Commit 896d81fe authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Revert "tty: Fix ldisc crash on reopened tty"

This reverts commit 71472fa9.  It caused
merge issues, and Dmitry found some review issues.
Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Michael Neuling <mikey@neuling.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent acbdad8d
...@@ -669,17 +669,16 @@ int tty_ldisc_reinit(struct tty_struct *tty, int disc) ...@@ -669,17 +669,16 @@ int tty_ldisc_reinit(struct tty_struct *tty, int disc)
tty_ldisc_put(tty->ldisc); tty_ldisc_put(tty->ldisc);
} }
/* switch the line discipline */
tty->ldisc = ld;
tty_set_termios_ldisc(tty, disc); tty_set_termios_ldisc(tty, disc);
retval = tty_ldisc_open(tty, ld); retval = tty_ldisc_open(tty, tty->ldisc);
if (retval) { if (retval) {
if (!WARN_ON(disc == N_TTY)) { if (!WARN_ON(disc == N_TTY)) {
tty_ldisc_put(ld); tty_ldisc_put(tty->ldisc);
ld = NULL; tty->ldisc = NULL;
} }
} }
/* switch the line discipline */
smp_store_release(&tty->ldisc, ld);
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment