projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b4ec22
)
iio: light: si1133: fix uninitialized resp variable
author
Maxime Roussin-Bélanger
<
[email protected]
>
Tue, 31 Jul 2018 20:13:21 +0000
(16:13 -0400)
committer
Jonathan Cameron
<
[email protected]
>
Wed, 1 Aug 2018 18:01:35 +0000
(19:01 +0100)
Read response register to detect any error.
Signed-off-by: Maxime Roussin-Bélanger <
[email protected]
>
Reported-by: Dan Carpenter <
[email protected]
>
Signed-off-by: Jonathan Cameron <
[email protected]
>
drivers/iio/light/si1133.c
patch
|
blob
|
history
diff --git
a/drivers/iio/light/si1133.c
b/drivers/iio/light/si1133.c
index 5ac22c46da1f1ebb324aa4e75ea1991898a816d3..015a21f0c2ef412de69b0d180f6982e183840d1d 100644
(file)
--- 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,