Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: Avoid unnecessary temporaries for tty->ldisc

tty_ldisc_setup() is race-free and can reference tty->ldisc without
snapshots.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Peter Hurley and committed by
Greg Kroah-Hartman
9de2a7ce 133b1306

+2 -5
+2 -5
drivers/tty/tty_ldisc.c
··· 752 752 753 753 int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty) 754 754 { 755 - struct tty_ldisc *ld = tty->ldisc; 756 - int retval; 757 - 758 - retval = tty_ldisc_open(tty, ld); 755 + int retval = tty_ldisc_open(tty, tty->ldisc); 759 756 if (retval) 760 757 return retval; 761 758 762 759 if (o_tty) { 763 760 retval = tty_ldisc_open(o_tty, o_tty->ldisc); 764 761 if (retval) { 765 - tty_ldisc_close(tty, ld); 762 + tty_ldisc_close(tty, tty->ldisc); 766 763 return retval; 767 764 } 768 765 }