All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Haojian Zhuang <haojian.zhuang@marvell.com>
Subject: Re: [PATCH] regulator: 88pm8607 - fix value range checking for accessing info->vol_table
Date: Sun, 5 Sep 2010 09:49:15 +0100	[thread overview]
Message-ID: <20100905084915.GD24817@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1283613048.2430.5.camel@phoenix>

On Sat, Sep 04, 2010 at 11:10:48PM +0800, Axel Lin wrote:
> In choose_voltage(), we use i as array index of info->vol_table.
> The valid value range for i should be 0 .. ARRAY_SIZE(info->vol_table) - 1.
> 
> Take LDO1 as example, ARRAY_SIZE(LDO1_table) is 4, vol_nbits of LDO1 is 2.
> for (i = 0; i < (2 << info->vol_nbits); i++)  is equivalent to
> for (i = 0; i < 8; i++)
> which is wrong.
> 
> The same value range checking also applies for index in pm8607_list_voltage().
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Mark Brown <broonie@openource.wolfsonmicro.com>

      reply	other threads:[~2010-09-05  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-04 15:10 [PATCH] regulator: 88pm8607 - fix value range checking for accessing info->vol_table Axel Lin
2010-09-05  8:49 ` Mark Brown [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=20100905084915.GD24817@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=axel.lin@gmail.com \
    --cc=haojian.zhuang@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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.