diff --git a/[refs] b/[refs] index 69387d0844b7..e3f0525ac6da 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5d0fdf1e01899805b6c2c0b789a707dcb731b1ea +refs/heads/master: 0ee9cbb3c705903db9c258047d9ce87096e6a1a1 diff --git a/trunk/drivers/char/tty_ioctl.c b/trunk/drivers/char/tty_ioctl.c index d6353d89b451..851cfcd2702a 100644 --- a/trunk/drivers/char/tty_ioctl.c +++ b/trunk/drivers/char/tty_ioctl.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -61,11 +62,13 @@ void tty_wait_until_sent(struct tty_struct *tty, long timeout) return; if (!timeout) timeout = MAX_SCHEDULE_TIMEOUT; + lock_kernel(); if (wait_event_interruptible_timeout(tty->write_wait, - !tty->driver->chars_in_buffer(tty), timeout) < 0) - return; - if (tty->driver->wait_until_sent) - tty->driver->wait_until_sent(tty, timeout); + !tty->driver->chars_in_buffer(tty), timeout) >= 0) { + if (tty->driver->wait_until_sent) + tty->driver->wait_until_sent(tty, timeout); + } + unlock_kernel(); } EXPORT_SYMBOL(tty_wait_until_sent);