This reverts commit
71472fa9c52b1da27663c275d416d8654b905f05. It caused
merge issues, and Dmitry found some review issues.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reported-by: Stephen 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tty_ldisc_put(tty->ldisc);
}
+ /* switch the line discipline */
+ tty->ldisc = ld;
tty_set_termios_ldisc(tty, disc);
- retval = tty_ldisc_open(tty, ld);
+ retval = tty_ldisc_open(tty, tty->ldisc);
if (retval) {
if (!WARN_ON(disc == N_TTY)) {
- tty_ldisc_put(ld);
- ld = NULL;
+ tty_ldisc_put(tty->ldisc);
+ tty->ldisc = NULL;
}
}
-
- /* switch the line discipline */
- smp_store_release(&tty->ldisc, ld);
return retval;
}