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

* Re: tty: incorrect test of echo_buf() result for ECHO_OP_START
       [not found] ` <CABPwjKd-e+Pq5OsNptn243WJ0a=qKizAsB3KATekMRTvsHab+g@mail.gmail.com>
@ 2013-10-11 22:16   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2013-10-11 22:16 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Jiri Slaby, lkml, Andrew Morton

On Sat, Oct 12, 2013 at 12:04:50AM +0200, Roel Kluin wrote:
> Adding Andrew to CC, thanks for comments & picking up my patches, BTW.

Given that Jiri and I are the tty/serial maintainers, we should be able
to handle this, give us a few days to catch up with patches sent before
yours...

thanks,

greg k-h

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

* Re: tty: incorrect test of echo_buf() result for ECHO_OP_START
  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:47 ` Peter Hurley
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Hurley @ 2013-10-11 22:47 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Greg Kroah-Hartman, Jiri Slaby, linux-kernel

On 10/11/2013 04:08 PM, Roel Kluin wrote:
> Untested, but this looks like a bug to me

Careless error on my part. Fix looks good; thanks for catching this.

Regards,
Peter Hurley

> -----------
> 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	[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