Signed-off-by: Matthieu CASTET <castet.matthieu@xxxxxxx> --- drivers/tty/tty_buffer.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 0e0f0fa..8cc7ceb 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -437,17 +437,15 @@ static void flush_to_ldisc(struct work_struct *work) */ if (test_bit(TTY_LDISC_CHANGING, &tty->flags)) break; - if (!tty->receive_room) - break; - if (count > tty->receive_room) - count = tty->receive_room; char_buf = head->char_buf_ptr + head->read; flag_buf = head->flag_buf_ptr + head->read; - head->read += count; spin_unlock_irqrestore(&tty->buf.lock, flags); - disc->ops->receive_buf(tty, char_buf, + count = disc->ops->receive_buf(tty, char_buf, flag_buf, count); spin_lock_irqsave(&tty->buf.lock, flags); + if (count == 0) + break; + head->read += count; } clear_bit(TTY_FLUSHING, &tty->flags); } -- 1.7.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html