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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <524C0E4B.4050603@nvidia.com>
Date:	Wed, 2 Oct 2013 17:45:07 +0530
From:	Laxman Dewangan <ldewangan@...dia.com>
To:	Axel Lin <axel.lin@...ics.com>
CC:	Mark Brown <broonie@...nel.org>,
	Florian Lobmaier <florian.lobmaier@....com>,
	Liam Girdwood <lgirdwood@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFT][PATCH 2/2] regulator: as3722: Fix off-by-one n_voltages
 setting for SDx

On Tuesday 01 October 2013 09:05 PM, Axel Lin wrote:
> AS3722_SDx_VSEL_MAX means the maximum selector, the n_voltages should be
> AS3722_SDx_VSEL_MAX + 1.
>
> Signed-off-by: Axel Lin <axel.lin@...ics.com>
> ---
>   drivers/regulator/as3722-regulator.c | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/regulator/as3722-regulator.c b/drivers/regulator/as3722-regulator.c
> index c6a1fc6..91b0abe 100644
> --- a/drivers/regulator/as3722-regulator.c
> +++ b/drivers/regulator/as3722-regulator.c
> @@ -99,7 +99,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
>   		.sleep_ctrl_mask = AS3722_SD0_EXT_ENABLE_MASK,
>   		.control_reg = AS3722_SD0_CONTROL_REG,
>   		.mode_mask = AS3722_SD0_MODE_FAST,
> -		.n_voltages = AS3722_SD0_VSEL_MAX,
> +		.n_voltages = AS3722_SD0_VSEL_MAX + 1,
>   	},

Agree, to allow the VSEL_MAX as valid value, it need to be +1 in n_voltages.

         if (selector >= rdev->desc->n_voltages)
                 return -EINVAL;


Originally, I offset this because of min_sel is  1 as thinking that 
n_voltages are number of voltages but it become MAX_VSEL. Seems my 
interpretation issue.

In header, it is defined as
#define AS3722_SD0_VSEL_MIN                             0x01
#define AS3722_SD0_VSEL_MAX                             0x5A
#define AS3722_SD2_VSEL_MIN                             0x01
#define AS3722_SD2_VSEL_MAX                             0x7F


Acked-by: Laxman Dewangan <ldewangan@...dia.com>

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ