X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fdrivers%2Ftty%2Fserial%2Fserial_core.c;fp=kernel%2Fdrivers%2Ftty%2Fserial%2Fserial_core.c;h=ec540445bb71f4386d4a30a66a6b7531ef919618;hb=fdb8b20906f3546ba6c2f9f0686d8a5189516ba3;hp=0b7bb12dfc68bc7edc45f7274a4e75acb9238a59;hpb=cc84a1f21026270463b580f2564f9d71912b20db;p=kvmfornfv.git diff --git a/kernel/drivers/tty/serial/serial_core.c b/kernel/drivers/tty/serial/serial_core.c index 0b7bb12df..ec540445b 100644 --- a/kernel/drivers/tty/serial/serial_core.c +++ b/kernel/drivers/tty/serial/serial_core.c @@ -1409,7 +1409,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp) mutex_lock(&port->mutex); uart_shutdown(tty, state); tty_port_tty_set(port, NULL); - tty->closing = 0; + spin_lock_irqsave(&port->lock, flags); if (port->blocked_open) { @@ -1435,6 +1435,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp) mutex_unlock(&port->mutex); tty_ldisc_flush(tty); + tty->closing = 0; } static void uart_wait_until_sent(struct tty_struct *tty, int timeout)