aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-02-22 12:14:53 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-02-24 13:32:05 +0000
commitc50fadeff758d4cc6e1ed196f776ae3016b3e021 (patch)
tree0a346595987156bd9bb9f8ca629e5dbfb4471844 /drivers/iio
parentiio: accel: bmc150: Remove redundant __func__ in dev_dbg() (diff)
downloadlinux-dev-c50fadeff758d4cc6e1ed196f776ae3016b3e021.tar.xz
linux-dev-c50fadeff758d4cc6e1ed196f776ae3016b3e021.zip
iio temperature/mlx90632: silence a static checker warning
This shouldn't affect runtime at all, but Smatch complains that we should check if mlx90632_read_ambient_raw() otherwise we "ambient_new_raw" can be uninitialized. drivers/iio/temperature/mlx90632.c:509 mlx90632_calc_ambient_dsp105() error: uninitialized symbol 'ambient_new_raw'. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Crt Mori <cmo@melexis.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/temperature/mlx90632.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
index d695ab97d27f..9851311aa3fd 100644
--- a/drivers/iio/temperature/mlx90632.c
+++ b/drivers/iio/temperature/mlx90632.c
@@ -506,6 +506,8 @@ static int mlx90632_calc_ambient_dsp105(struct mlx90632_data *data, int *val)
ret = mlx90632_read_ambient_raw(data->regmap, &ambient_new_raw,
&ambient_old_raw);
+ if (ret < 0)
+ return ret;
*val = mlx90632_calc_temp_ambient(ambient_new_raw, ambient_old_raw,
PT, PR, PG, PO, Gb);
return ret;