public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: davem@davemloft.net, lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] serial: off by one
Date: Thu, 4 Jun 2009 13:04:23 +0100 (WEST)	[thread overview]
Message-ID: <alpine.LFD.1.10.0906041303510.332@ftp.linux-mips.org> (raw)
In-Reply-To: <4A270541.4050900@gmail.com>

On Thu, 4 Jun 2009, Roel Kluin wrote:

> 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: Maciej W. Rozycki <macro@linux-mips.org>

  Maciej

      parent reply	other threads:[~2009-06-04 12:04 UTC|newest]

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

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=alpine.LFD.1.10.0906041303510.332@ftp.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.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