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] [day] [month] [year] [list]
Date:	Fri, 14 Dec 2012 10:56:57 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Axel Lin <axel.lin@...ics.com>
CC:	Jonathan Cameron <jic23@....ac.uk>, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	"Hennerich, Michael" <Michael.Hennerich@...log.com>
Subject: Re: [PATCH 1/6] iio: adc: ad7266: Don't set error code to st->vref_uv

On 12/14/2012 08:47 AM, Axel Lin wrote:
> regulator_get_voltage() may return negative error code.
> Add error checking to avoid setting error code to st->vref_uv.
> 
> Signed-off-by: Axel Lin <axel.lin@...ics.com>

Thanks Axel, for the whole series:
Acked-by: Lars-Peter Clausen <lars@...afoo.de>

> ---
>  drivers/iio/adc/ad7266.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c
> index a6f4fc5..e36107d 100644
> --- a/drivers/iio/adc/ad7266.c
> +++ b/drivers/iio/adc/ad7266.c
> @@ -411,7 +411,11 @@ static int __devinit ad7266_probe(struct spi_device *spi)
>  		if (ret)
>  			goto error_put_reg;
>  
> -		st->vref_uv = regulator_get_voltage(st->reg);
> +		ret = regulator_get_voltage(st->reg);
> +		if (ret < 0)
> +			goto error_disable_reg;
> +
> +		st->vref_uv = ret;
>  	} else {
>  		/* Use internal reference */
>  		st->vref_uv = 2500000;

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