From a98fb5280c69d90e85bb875177a68880089312b0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 9 Mar 2016 13:28:24 +0000 Subject: [PATCH] serial: Take care starting a hung-up tty's port 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 --- include/linux/serial_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -397,7 +397,7 @@ int uart_resume_port(struct uart_driver 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; } rm.submit();'> upstream openwrtJames
aboutsummaryrefslogtreecommitdiffstats
blob: f8229d06b1dc763f05237b597e949daf7df77b1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80