aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/serial/serial_core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 1689bda1d13b..dcc72444e8e7 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1270,6 +1270,9 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
1270 1270
1271 BUG_ON(!kernel_locked()); 1271 BUG_ON(!kernel_locked());
1272 1272
1273 if (!state)
1274 return;
1275
1273 uport = state->uart_port; 1276 uport = state->uart_port;
1274 port = &state->port; 1277 port = &state->port;
1275 1278
@@ -1316,9 +1319,9 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
1316 */ 1319 */
1317 if (port->flags & ASYNC_INITIALIZED) { 1320 if (port->flags & ASYNC_INITIALIZED) {
1318 unsigned long flags; 1321 unsigned long flags;
1319 spin_lock_irqsave(&port->lock, flags); 1322 spin_lock_irqsave(&uport->lock, flags);
1320 uport->ops->stop_rx(uport); 1323 uport->ops->stop_rx(uport);
1321 spin_unlock_irqrestore(&port->lock, flags); 1324 spin_unlock_irqrestore(&uport->lock, flags);
1322 /* 1325 /*
1323 * Before we drop DTR, make sure the UART transmitter 1326 * Before we drop DTR, make sure the UART transmitter
1324 * has completely drained; this is especially 1327 * has completely drained; this is especially