summaryrefslogtreecommitdiff
path: root/drivers/tty/tty_port.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-11-05 12:40:05 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-06 14:57:27 -0800
commit3f40f5b2a22110754ce469f5722bade8aeb241e5 (patch)
tree00959efe05c52314e168be06c9cb5f54cbf7547e /drivers/tty/tty_port.c
parent413ba6385382bc80e4bf2f58efa900e82e810b11 (diff)
tty: Flush tty buffers after hardware shutdown
The line discipline buffer and the tty buffers must be flushed again after hardware shutdown; otherwise, a brief window exists between the ldisc flush in tty_port_close_start() and the subsequent tty_port_shutdown(), during which more data could be received into the tty buffers. A racing open might then be able to receive data from the previous session. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_port.c')
-rw-r--r--drivers/tty/tty_port.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 3b641d115fd2..4d9abaa81be4 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -520,6 +520,7 @@ void tty_port_close_end(struct tty_port *port, struct tty_struct *tty)
{
unsigned long flags;
+ tty_ldisc_flush(tty);
tty->closing = 0;
spin_lock_irqsave(&port->lock, flags);