All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] applicom: Prevent unsigned wrap in ac_interrupt()
Date: Sun, 09 Aug 2009 22:30:46 +0200	[thread overview]
Message-ID: <4A7F31F6.9000706@gmail.com> (raw)
In-Reply-To: <4A7D961A.1020303@gmail.com>

On 08/08/2009 05:13 PM, Roel Kluin wrote:
> unsigned i wraps if this occurs in the first iteration.

Could you elaborate? I don't quite understand the point.

> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Or do we know this can't happen?

You mean the i--? It's followed by i++ in the for loop 3rd expression. Or?

> 
> diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
> index 73a0765..0df3e12 100644
> --- a/drivers/char/applicom.c
> +++ b/drivers/char/applicom.c
> @@ -670,7 +670,7 @@ static irqreturn_t ac_interrupt(int vec, void *dev_instance)
>  			}
>  			Dummy = readb(apbs[i].RamIO + VERS);
>  
> -			if(readb(apbs[i].RamIO + RAM_IT_TO_PC)) {
> +			if(i && readb(apbs[i].RamIO + RAM_IT_TO_PC)) {
>  				/* There's another int waiting on this card */
>  				spin_unlock(&apbs[i].mutex);
>  				i--;

  reply	other threads:[~2009-08-09 20:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-08 15:13 [PATCH] applicom: Prevent unsigned wrap in ac_interrupt() Roel Kluin
2009-08-09 20:30 ` Jiri Slaby [this message]
2009-08-11  8:54   ` roel kluin
2009-08-11  9:00     ` Jiri Slaby

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=4A7F31F6.9000706@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@linux-foundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.