lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 26 Oct 2009 13:45:32 +0000
From:	Liam Girdwood <lrg@...mlogic.co.uk>
To:	Roel Kluin <roel.kluin@...il.com>
Cc:	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] regulator: keep index within bounds in
 da9034_get_ldo12_voltage()

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@...il.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists