]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tty: incorrect test of echo_buf() result for ECHO_OP_START
authorRoel Kluin <roel.kluin@gmail.com>
Fri, 11 Oct 2013 20:08:49 +0000 (22:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2013 19:05:40 +0000 (11:05 -0800)
commit c476f6584b0011741b4f0316f1ac4aa3a99403e1 upstream.

test echo_buf() result for ECHO_OP_START

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c

index 118569f060377130cb7b55a31eabfb4c7c71c779..834fb60f4637faca59c40a21d6af6b27b906f500 100644 (file)
@@ -767,7 +767,7 @@ static size_t __process_echoes(struct tty_struct *tty)
         * of echo overrun before the next commit), then discard enough
         * data at the tail to prevent a subsequent overrun */
        while (ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) {
-               if (echo_buf(ldata, tail == ECHO_OP_START)) {
+               if (echo_buf(ldata, tail) == ECHO_OP_START) {
                        if (echo_buf(ldata, tail) == ECHO_OP_ERASE_TAB)
                                tail += 3;
                        else