diff options
author | Phil Elwell <phil@raspberrypi.org> | 2016-03-09 13:28:24 +0000 |
---|---|---|
committer | popcornmix <popcornmix@gmail.com> | 2016-03-09 17:46:51 +0000 |
commit | 74105533c976f03ef137d9d8c43464b09a79b141 (patch) | |
tree | c30c9caba43985990714240559cbd969f53273d5 | |
parent | 1f133059e579d7aeef76ab8402b95eb4418e8ca4 (diff) |
serial: Take care starting a hung-up tty's portrpi-bootloader-1.20160309-1
tty_port_hangup sets a port's tty field to NULL (holding the port lock),
but uart_tx_stopped, called from __uart_start (with the port lock),
uses the tty field without checking for NULL.
Change uart_tx_stopped to treat a NULL tty field as another stopped
indication.
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
-rw-r--r-- | include/linux/serial_core.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 025dad9dcde4..8adf60c99a1d 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -397,7 +397,7 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port); static inline int uart_tx_stopped(struct uart_port *port) { struct tty_struct *tty = port->state->port.tty; - if (tty->stopped || port->hw_stopped) + if (!tty || tty->stopped || port->hw_stopped) return 1; return 0; } |