public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] hwmon: using wrong ARRAY_SIZE() limit
Date: Thu, 18 Jul 2013 15:41:08 +0000	[thread overview]
Message-ID: <51E80C94.50709@bfs.de> (raw)
In-Reply-To: <20130717084317.GA4851@elgon.mountain>



Am 18.07.2013 01:36, schrieb Guenter Roeck:
> On Wed, Jul 17, 2013 at 03:26:14PM +0300, Dan Carpenter wrote:
>> We cleaned up this code to use ARRAY_SIZE() instead of just the number
>> 4.  The problem is that data->reg_temp[] has 5 elements and we actually
>> wanted ARRAY_SIZE(data->temp) which has 4 elements.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>
> Hi Dan,
> 
> good catch, except that the array size of data->temp[] should be 5, not 4.
> So the real culprit is commit 7cbbd6a (Add support for critical low/high
> temperature limits on NCT6106) which increased the size of reg_temp but not the
> size of temp.
> 
> Do you want to send me a patch fixing that, or should I take care of it ?
> 
> Thanks,
> Guenter

hi Guenther,
is an array the way to go here ? To avoid that kind of problems they sould be
connected some how. Is it possible to replace the array with a malloc() ?

re,
 wh




  parent reply	other threads:[~2013-07-18 15:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 12:26 [patch] hwmon: using wrong ARRAY_SIZE() limit Dan Carpenter
2013-07-17 23:36 ` Guenter Roeck
2013-07-18 15:41 ` walter harms [this message]
2013-07-18 20:43 ` Guenter Roeck

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=51E80C94.50709@bfs.de \
    --to=wharms@bfs.de \
    --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