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>
This commit is contained in:
committed by
Jonathan Cameron
parent
2b4ec22d36
commit
496fb59e12
@@ -409,6 +409,9 @@ static int si1133_command(struct si1133_data *data, u8 cmd)
|
|||||||
err = -ETIMEDOUT;
|
err = -ETIMEDOUT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
err = regmap_read(data->regmap, SI1133_REG_RESPONSE0, &resp);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
err = regmap_read_poll_timeout(data->regmap,
|
err = regmap_read_poll_timeout(data->regmap,
|
||||||
SI1133_REG_RESPONSE0, resp,
|
SI1133_REG_RESPONSE0, resp,
|
||||||
|
|||||||
Reference in New Issue
Block a user