public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] regulator: keep index within bounds in da9034_get_ldo12_voltage()
       [not found] <4AE589E7.7000504@gmail.com>
@ 2009-10-26 13:45 ` Liam Girdwood
  0 siblings, 0 replies; only message in thread
From: Liam Girdwood @ 2009-10-26 13:45 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Mark Brown, Andrew Morton, linux-kernel

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-26 13:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4AE589E7.7000504@gmail.com>
2009-10-26 13:45 ` [PATCH] regulator: keep index within bounds in da9034_get_ldo12_voltage() Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox