diff options
-rw-r--r-- | drivers/tty/serial/serial_core.c | 2 | ||||
-rw-r--r-- | drivers/tty/tty_port.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 127ac6c..3e08df5 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1368,8 +1368,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp) tty_ldisc_flush(tty); tty_port_tty_set(port, NULL); - spin_lock_irqsave(&port->lock, flags); tty->closing = 0; + spin_lock_irqsave(&port->lock, flags); if (port->blocked_open) { spin_unlock_irqrestore(&port->lock, flags); diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 7309594..9209d63 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -497,9 +497,10 @@ int tty_port_close_start(struct tty_port *port, return 0; } set_bit(ASYNCB_CLOSING, &port->flags); - tty->closing = 1; spin_unlock_irqrestore(&port->lock, flags); + tty->closing = 1; + if (test_bit(ASYNCB_INITIALIZED, &port->flags)) { /* Don't block on a stalled port, just pull the chain */ if (tty->flow_stopped) @@ -522,9 +523,10 @@ void tty_port_close_end(struct tty_port *port, struct tty_struct *tty) { unsigned long flags; - spin_lock_irqsave(&port->lock, flags); tty->closing = 0; + spin_lock_irqsave(&port->lock, flags); + if (port->blocked_open) { spin_unlock_irqrestore(&port->lock, flags); if (port->close_delay) { |