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]
Message-ID: <9772b4fa-8a26-9ddd-7a16-c6f404cccbc1@kernel.org>
Date:	Sat, 23 Apr 2016 22:18:38 +0100
From:	Jonathan Cameron <jic23@...nel.org>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Hartmut Knaack <knaack.h@....de>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Peter Meerwald-Stadler <pmeerw@...erw.net>,
	Matt Ranostay <mranostay@...il.com>, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] iio: light: apds9960: silence uninitialized variable
 warning

On 22/04/16 11:04, Dan Carpenter wrote:
> It causes a static checker warning if we use "buf" on the failure path
> so move that inside the if statement.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Applied to the togreg branch of iio.git,

Thanks,

Jonathan
> 
> diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c
> index a6af56a..fbdd172 100644
> --- a/drivers/iio/light/apds9960.c
> +++ b/drivers/iio/light/apds9960.c
> @@ -491,9 +491,10 @@ static int apds9960_read_raw(struct iio_dev *indio_dev,
>  		case IIO_INTENSITY:
>  			ret = regmap_bulk_read(data->regmap, chan->address,
>  					       &buf, 2);
> -			if (!ret)
> +			if (!ret) {
>  				ret = IIO_VAL_INT;
> -			*val = le16_to_cpu(buf);
> +				*val = le16_to_cpu(buf);
> +			}
>  			break;
>  		default:
>  			ret = -EINVAL;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ