summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-11 07:41:08 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-28 00:01:44 +0100
commit9de2a7cef983579c725564950384e4ea205a7684 (patch)
tree8649032a8af271b383bbeac68c2f289d4eb6d279
parenttty: Document c_line == N_TTY initial condition (diff)
downloadlinux-9de2a7cef983579c725564950384e4ea205a7684.tar.xz
linux-9de2a7cef983579c725564950384e4ea205a7684.zip
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>
-rw-r--r--drivers/tty/tty_ldisc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index c6f970d63060..4cb5e572c7b8 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -752,17 +752,14 @@ void tty_ldisc_hangup(struct tty_struct *tty, bool reinit)
int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty)
{
- struct tty_ldisc *ld = tty->ldisc;
- int retval;
-
- retval = tty_ldisc_open(tty, ld);
+ int retval = tty_ldisc_open(tty, tty->ldisc);
if (retval)
return retval;
if (o_tty) {
retval = tty_ldisc_open(o_tty, o_tty->ldisc);
if (retval) {
- tty_ldisc_close(tty, ld);
+ tty_ldisc_close(tty, tty->ldisc);
return retval;
}
}