summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;