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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 22 Jun 2011 02:48:56 +0000 (GMT)
From:	함명주 <myungjoo.ham@...sung.com>
To:	Tushar Behera <tushar.behera@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linaro-dev@...ts.linaro.org" <linaro-dev@...ts.linaro.org>
Cc:	"patches@...aro.org" <patches@...aro.org>,
	"lrg@...com" <lrg@...com>,
	"broonie@...nsource.wolfsonmicro.com" 
	<broonie@...nsource.wolfsonmicro.com>,
	박경민 <kyungmin.park@...sung.com>,
	Samuel Ortiz <sameo@...ux.intel.com>
Subject: Re: [PATCH] regulator: MAX8997: Fix for divide by zero error

Sender : Tushar Behera<tushar.behera@...aro.org>
Date : 2011-06-21 12:38 (GMT+09:00)
> Currently, ramp_delay variable is used uninitialzed in
> max8997_set_voltage_ldobuck which gets called through
> regulator_register calls.
> 
> To fix the problem, in max8997_pmic_probe, ramp_delay initialization
> code is moved before calls to regulator_register.
> 
> Cc: Liam Girdwood 
> Cc: Mark Brown 
> Cc: MyungJoo Ham 
> Cc: Kyungmin Park 
> Cc: Samuel Ortiz 
> Signed-off-by: Tushar Behera 

Although I've never been reported such an issue, but I'm sure this will cause one any time. Thanks!

Acked-by: MyungJoo Ham <myungjoo.ham@...sung.com>

> ---
> drivers/regulator/max8997.c |    8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
> index 10d5a1d..0fc7b8c 100644
> --- a/drivers/regulator/max8997.c
> +++ b/drivers/regulator/max8997.c
> @@ -1124,6 +1124,10 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
> 0x3f);
> }
> 
> + /* Misc Settings */
> + max8997->ramp_delay = 10; /* set 10mV/us, which is the default */
> + max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9);
> +
> for (i = 0; i < pdata->num_regulators; i++) {
> const struct voltage_map_desc *desc;
> int id = pdata->regulators[i].id;
> @@ -1148,10 +1152,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
> }
> }
> 
> - /* Misc Settings */
> - max8997->ramp_delay = 10; /* set 10mV/us, which is the default */
> - max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9);
> -
> return 0;
> err:
> for (i = 0; i < max8997->num_regulators; i++)
> -- 
> 1.7.4.1
> 
> 



 MyungJoo Ham (함명주)
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: +82-10-6714-2858 / office: +82-31-279-8033

Powered by blists - more mailing lists