Commit 496fb59e authored by Maxime Roussin-Bélanger's avatar Maxime Roussin-Bélanger Committed by Jonathan Cameron

iio: light: si1133: fix uninitialized resp variable

Read response register to detect any error.
Signed-off-by: default avatarMaxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 2b4ec22d
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment