mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: roel.kluin@gmail.com
Cc: macro@linux-mips.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH] serial: off by one
Date: Wed, 03 Jun 2009 21:18:23 -0700 (PDT)	[thread overview]
Message-ID: <20090603.211823.192890836.davem@davemloft.net> (raw)
In-Reply-To: <4A270541.4050900@gmail.com>

From: Roel Kluin <roel.kluin@gmail.com>
Date: Thu, 04 Jun 2009 01:20:33 +0200

> In zs_console_putchar() occurs:
> 
> 	if (zs_transmit_drain(zport, irq))
> 		write_zsdata(zport, ch);
> 
> However if in zs_transmit_drain() no empty Tx Buffer occurs, limit reaches
> -1 => true, and the write still occurs.
> 
> This patch changes postfix to prefix decrements in this and similar
> functions to prevent similar mistakes in the future. This decreases the
> iterations with one but the chosen loop count was arbitrary anyway.
> 
> In sunhv limit reaches -1, not 0, so the test is off by one.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Acked-by: David S. Miller <davem@davemloft.net>

  reply	other threads:[~2009-06-04  4:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 23:20 Roel Kluin
2009-06-04  4:18 ` David Miller [this message]
2009-06-04 12:04 ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090603.211823.192890836.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=roel.kluin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®