n_tty: Fix unsafe reference to "other" ldisc
authorPeter Hurley <peter@hurleysoftware.com>
Mon, 11 Jan 2016 06:40:56 +0000 (22:40 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2016 20:31:02 +0000 (12:31 -0800)
commitcccd9546e993ddcd10a482e43a821420cb09c05d
tree6b0fffaf39eae0fe8eed7c46a2b928a9f6688fa5
parent46f0b319cd828cc52bce8a94ff6c010efbfbb660
n_tty: Fix unsafe reference to "other" ldisc

commit 6d27a63caad3f13e96cf065d2d96828c2006be6b upstream.

Although n_tty_check_unthrottle() has a valid ldisc reference (since
the tty core gets the ldisc ref in tty_read() before calling the line
discipline read() method), it does not have a valid ldisc reference to
the "other" pty of a pty pair. Since getting an ldisc reference for
tty->link essentially open-codes tty_wakeup(), just replace with the
equivalent tty_wakeup().

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