n_tty: Fix unsafe reference to "other" ldisc
authorPeter Hurley <peter@hurleysoftware.com>
Mon, 11 Jan 2016 06:40:56 +0000 (22:40 -0800)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 15 Feb 2016 20:45:24 +0000 (15:45 -0500)
commit28b824966ab269de94e0ca640b7c61aedc6a83de
treec4854c116d7f40f0b2949e998b1b7e780faae545
parent27055738c910ee29a9de4b496e198e17b38b0eed
n_tty: Fix unsafe reference to "other" ldisc

[ Upstream commit 6d27a63caad3f13e96cf065d2d96828c2006be6b ]

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().

Cc: <stable@vger.kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/tty/n_tty.c