diff options
author | Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> | 2018-07-31 16:13:21 -0400 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2018-08-01 19:01:35 +0100 |
commit | 496fb59e1274086d0c67681fb1369e9941660dd9 (patch) | |
tree | f1548abc1e4d778c52fe737b122a1bde026d2e79 /drivers/iio | |
parent | 2b4ec22d36d46d03d01d1ec2436080d982284f36 (diff) |
iio: light: si1133: fix uninitialized resp variable
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>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/light/si1133.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c index 5ac22c46da1f..015a21f0c2ef 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, |