tty: incorrect test of echo_buf() result for ECHO_OP_START
authorRoel Kluin <[email protected]>
Fri, 11 Oct 2013 20:08:49 +0000 (22:08 +0200)
committerGreg Kroah-Hartman <[email protected]>
Wed, 16 Oct 2013 20:12:13 +0000 (13:12 -0700)
test echo_buf() result for ECHO_OP_START

Signed-off-by: Roel Kluin <[email protected]>
Acked-by: Peter Hurley <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/tty/n_tty.c

index 4e69f3bd7fd864e9d53e4edfe5293ea9d97ee924..7cdd1eb9406c11ccb4870560490f0c6036f92032 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