Linux I2C development
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Adrian Bunk <bunk@kernel.org>
Cc: i2c@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [2.6 patch] i2c-amd756.c: fix off-by-one
Date: Thu, 28 Feb 2008 21:05:42 +0100	[thread overview]
Message-ID: <20080228210542.1c774c28@hyperion.delvare> (raw)
In-Reply-To: <20080227212108.GR29269@cs181133002.pp.htv.fi>

Hi Adrian,

On Wed, 27 Feb 2008 23:21:09 +0200, Adrian Bunk wrote:
> This patch fixes an off-by-one error spotted by the Coverity checker.
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
> 
> ---
> f9829dd0d7dad9cbc08da3fceb105478e85c4137 foobar
> diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
> index 573abe4..2fa4318 100644
> --- a/drivers/i2c/busses/i2c-amd756.c
> +++ b/drivers/i2c/busses/i2c-amd756.c
> @@ -335,7 +335,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
>  	u8 temp;
>  	
>  	/* driver_data might come from user-space, so check it */
> -	if (id->driver_data > ARRAY_SIZE(chipname))
> +	if (id->driver_data >= ARRAY_SIZE(chipname))
>  		return -EINVAL;
>  
>  	if (amd756_ioport) {
> 

Good catch, not sure how I managed to mess it up that way. Patch
applied, thank you.

-- 
Jean Delvare

      reply	other threads:[~2008-02-28 20:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-27 21:21 [2.6 patch] i2c-amd756.c: fix off-by-one Adrian Bunk
2008-02-28 20:05 ` Jean Delvare [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=20080228210542.1c774c28@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=bunk@kernel.org \
    --cc=i2c@lm-sensors.org \
    --cc=linux-kernel@vger.kernel.org \
    /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