linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] iio: light: si1133: fix uninitialized resp variable
@ 2018-07-31 20:13 Maxime Roussin-Bélanger
  2018-08-01 18:02 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Roussin-Bélanger @ 2018-07-31 20:13 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler
  Cc: linux-iio, Maxime Roussin-Bélanger

Read response register to detect any error.

Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
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,
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] iio: light: si1133: fix uninitialized resp variable
  2018-07-31 20:13 [PATCH v2] iio: light: si1133: fix uninitialized resp variable Maxime Roussin-Bélanger
@ 2018-08-01 18:02 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-08-01 18:02 UTC (permalink / raw)
  To: Maxime Roussin-Bélanger
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio

On Tue, 31 Jul 2018 16:13:21 -0400
Maxime Roussin-B=C3=A9langer <maxime.roussinbelanger@gmail.com> wrote:

> Read response register to detect any error.
>=20
> Signed-off-by: Maxime Roussin-B=C3=A9langer <maxime.roussinbelanger@gmail=
.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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
>=20
>  drivers/iio/light/si1133.c | 3 +++
>  1 file changed, 3 insertions(+)
>=20
> 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, u=
8 cmd)
>  			err =3D -ETIMEDOUT;
>  			goto out;
>  		}
> +		err =3D regmap_read(data->regmap, SI1133_REG_RESPONSE0, &resp);
> +		if (err)
> +			goto out;
>  	} else {
>  		err =3D regmap_read_poll_timeout(data->regmap,
>  					       SI1133_REG_RESPONSE0, resp,


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-01 19:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-31 20:13 [PATCH v2] iio: light: si1133: fix uninitialized resp variable Maxime Roussin-Bélanger
2018-08-01 18:02 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).