From 75f3406ace42a4da91714d49ad659d35a9a22e3e Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 7 Mar 2013 15:55:53 +0100 Subject: [PATCH] --- yaml --- r: 364244 b: refs/heads/master c: 0b2588cadf9f131614cb251e34f7be1f4e1a2e08 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/tty/tty_port.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 7b8a82f4145c..35f31a6f3c8f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b74414f5f3227d9db309bfaaea3ae889af01430a +refs/heads/master: 0b2588cadf9f131614cb251e34f7be1f4e1a2e08 diff --git a/trunk/drivers/tty/tty_port.c b/trunk/drivers/tty/tty_port.c index 20426ccbd58b..969c3e675a76 100644 --- a/trunk/drivers/tty/tty_port.c +++ b/trunk/drivers/tty/tty_port.c @@ -487,14 +487,16 @@ int tty_port_close_start(struct tty_port *port, set_bit(ASYNCB_CLOSING, &port->flags); tty->closing = 1; spin_unlock_irqrestore(&port->lock, flags); - /* Don't block on a stalled port, just pull the chain */ - if (tty->flow_stopped) - tty_driver_flush_buffer(tty); - if (test_bit(ASYNCB_INITIALIZED, &port->flags) && - port->closing_wait != ASYNC_CLOSING_WAIT_NONE) - tty_wait_until_sent_from_close(tty, port->closing_wait); - if (port->drain_delay) - tty_port_drain_delay(port, tty); + + if (test_bit(ASYNCB_INITIALIZED, &port->flags)) { + /* Don't block on a stalled port, just pull the chain */ + if (tty->flow_stopped) + tty_driver_flush_buffer(tty); + if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) + tty_wait_until_sent_from_close(tty, port->closing_wait); + if (port->drain_delay) + tty_port_drain_delay(port, tty); + } /* Flush the ldisc buffering */ tty_ldisc_flush(tty);