Re: [PATCH v2] iio: light: si1133: fix uninitialized resp variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 31 Jul 2018 16:13:21 -0400
Maxime Roussin-Bélanger <maxime.roussinbelanger@xxxxxxxxx> wrote:

> Read response register to detect any error.
> 
> Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@xxxxxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Thanks.  Given the announced delay in the merge window opening I'm
going to make an optimistic pull request and this just snuck in.

Applied to the togreg branch of iio.git.

Thanks,

Jonathan

> ---
> Changes in v2:
> 	- Added missing signed-off-by
> 
>  drivers/iio/light/si1133.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c
> index d3fbeb3bc463..9b8862af0127 100644
> --- a/drivers/iio/light/si1133.c
> +++ b/drivers/iio/light/si1133.c
> @@ -409,6 +409,9 @@ static int si1133_command(struct si1133_data *data, u8 cmd)
>  			err = -ETIMEDOUT;
>  			goto out;
>  		}
> +		err = regmap_read(data->regmap, SI1133_REG_RESPONSE0, &resp);
> +		if (err)
> +			goto out;
>  	} else {
>  		err = regmap_read_poll_timeout(data->regmap,
>  					       SI1133_REG_RESPONSE0, resp,

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux