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

TTY: fix DTR being raised on hang up

Make sure to check ASYNC_INITIALISED before raising DTR when waking up
from blocked open in tty_port_block_til_ready.

Currently DTR could get raised at hang up as a blocked process would
raise DTR unconditionally before checking for hang up and returning.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
e584a02c 31ca020b

+1 -1
+1 -1
drivers/tty/tty_port.c
··· 388 388 389 389 while (1) { 390 390 /* Indicate we are open */ 391 - if (tty->termios.c_cflag & CBAUD) 391 + if (C_BAUD(tty) && test_bit(ASYNCB_INITIALIZED, &port->flags)) 392 392 tty_port_raise_dtr_rts(port); 393 393 394 394 prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE);