From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: e5e9f44c causes buffer under-runs
Date: Wed, 03 Mar 2010 16:59:41 +0000 [thread overview]
Message-ID: <20100303165941.GA5039@bicker> (raw)
In-Reply-To: <20100303070914.GE5086@bicker>
On Wed, Mar 03, 2010 at 01:43:56PM +0100, Jean Delvare wrote:
> Hi Dan,
>
> On Wed, 3 Mar 2010 10:09:14 +0300, Dan Carpenter wrote:
> > Smatch complains about: e5e9f44c2 i2c: Drop I2C_CLIENT_INSMOD_2 to 8
> >
> > The original define had an "any_chip", but this patch removed it.
> >
> > -#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \
> > -enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
> > - chip7, chip8 }
> >
> > This causes some buffer under runs.
> >
> > drivers/hwmon/fschmd.c +1040 fschmd_detect(33) warn: array offset '(kind-1)' can be negative (-1)
> > drivers/hwmon/tmp401.c +527 tmp401_detect(37) warn: array offset '(kind-1)' can be negative (-1)
> > drivers/hwmon/tmp421.c +255 tmp421_detect(30) warn: array offset '(kind-1)' can be negative (-1)
> > drivers/hwmon/tmp421.c +256 tmp421_detect(31) warn: array offset '(kind-1)' can be negative (-1)
> >
> > (From a test version of smatch).
>
> Thanks a lot for reporting. I was well aware that these drivers would
> need special care when getting rid of the I2C_CLIENT_INSMOD_* macros,
> and I _thought_ I had taken care, I even seem to remember changing the
> code in question... but apparently I managed to lose the changes
> somewhere in the process. Sigh.
>
> The following patch should fix it. Please apply it, run smatch again
> and confirm the warnings are gone.
>
Looks good. You cleaned up the code nicely.
regards,
dan carpenter
next prev parent reply other threads:[~2010-03-03 16:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-03 7:09 e5e9f44c causes buffer under-runs Dan Carpenter
2010-03-03 12:43 ` Jean Delvare
2010-03-03 16:59 ` Dan Carpenter [this message]
2010-03-03 20:59 ` [lm-sensors] " Andre Prendel
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=20100303165941.GA5039@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@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