public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* tty: incorrect test of echo_buf() result for ECHO_OP_START
@ 2013-10-11 20:08 Roel Kluin
       [not found] ` <CABPwjKd-e+Pq5OsNptn243WJ0a=qKizAsB3KATekMRTvsHab+g@mail.gmail.com>
  2013-10-11 22:47 ` Peter Hurley
  0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2013-10-11 20:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-kernel

Untested, but this looks like a bug to me
-----------
test echo_buf() result for ECHO_OP_START

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 7a744b6..42b6cca 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-11 22:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-11 20:08 tty: incorrect test of echo_buf() result for ECHO_OP_START Roel Kluin
     [not found] ` <CABPwjKd-e+Pq5OsNptn243WJ0a=qKizAsB3KATekMRTvsHab+g@mail.gmail.com>
2013-10-11 22:16   ` Greg Kroah-Hartman
2013-10-11 22:47 ` Peter Hurley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox