From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regulator: keep index within bounds in da9034_get_ldo12_voltage()
Date: Mon, 26 Oct 2009 13:45:32 +0000 [thread overview]
Message-ID: <1256564732.3530.344.camel@odin> (raw)
In-Reply-To: <4AE589E7.7000504@gmail.com>
On Mon, 2009-10-26 at 12:37 +0100, Roel Kluin wrote:
> If selector equals ARRAY_SIZE(da9034_ldo12_data), that is one too
> large already.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> drivers/regulator/da903x.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/regulator/da903x.c b/drivers/regulator/da903x.c
> index aa224d9..f8c4661 100644
> --- a/drivers/regulator/da903x.c
> +++ b/drivers/regulator/da903x.c
> @@ -331,7 +331,7 @@ static int da9034_get_ldo12_voltage(struct regulator_dev *rdev)
> static int da9034_list_ldo12_voltage(struct regulator_dev *rdev,
> unsigned selector)
> {
> - if (selector > ARRAY_SIZE(da9034_ldo12_data))
> + if (selector >= ARRAY_SIZE(da9034_ldo12_data))
> return -EINVAL;
> return da9034_ldo12_data[selector] * 1000;
> }
Applied.
Thanks
Liam
parent reply other threads:[~2009-10-26 13:45 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <4AE589E7.7000504@gmail.com>]
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=1256564732.3530.344.camel@odin \
--to=lrg@slimlogic.co.uk \
--cc=akpm@linux-foundation.org \
--cc=broonie@opensource.wolfsonmicro.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox