1 From 35370cf396896477ee7e8cb044779a3ee9257a7e Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Wed, 9 Mar 2016 13:28:24 +0000
4 Subject: [PATCH 202/381] serial: Take care starting a hung-up tty's port
6 tty_port_hangup sets a port's tty field to NULL (holding the port lock),
7 but uart_tx_stopped, called from __uart_start (with the port lock),
8 uses the tty field without checking for NULL.
10 Change uart_tx_stopped to treat a NULL tty field as another stopped
13 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
15 include/linux/serial_core.h | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
18 --- a/include/linux/serial_core.h
19 +++ b/include/linux/serial_core.h
20 @@ -397,7 +397,7 @@ int uart_resume_port(struct uart_driver
21 static inline int uart_tx_stopped(struct uart_port *port)
23 struct tty_struct *tty = port->state->port.tty;
24 - if (tty->stopped || port->hw_stopped)
25 + if (!tty || tty->stopped || port->hw_stopped)