Skip to content

Commit a23c14b

Browse files
harshimogalapallijic23
authored andcommitted
iio: temperature: mlx90635: Fix ERR_PTR dereference in mlx90635_probe()
When devm_regmap_init_i2c() fails, regmap_ee could be error pointer, instead of checking for IS_ERR(regmap_ee), regmap is checked which looks like a copy paste error. Fixes: a1d1ba5 ("iio: temperature: mlx90635 MLX90635 IR Temperature sensor") Reviewed-by: Crt Mori<cmo@melexis.com> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Link: https://lore.kernel.org/r/20240513203427.3208696-1-harshit.m.mogalapalli@oracle.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent bedb2cc commit a23c14b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/iio/temperature/mlx90635.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,9 @@ static int mlx90635_probe(struct i2c_client *client)
947947
"failed to allocate regmap\n");
948948

949949
regmap_ee = devm_regmap_init_i2c(client, &mlx90635_regmap_ee);
950-
if (IS_ERR(regmap))
951-
return dev_err_probe(&client->dev, PTR_ERR(regmap),
952-
"failed to allocate regmap\n");
950+
if (IS_ERR(regmap_ee))
951+
return dev_err_probe(&client->dev, PTR_ERR(regmap_ee),
952+
"failed to allocate EEPROM regmap\n");
953953

954954
mlx90635 = iio_priv(indio_dev);
955955
i2c_set_clientdata(client, indio_dev);

0 commit comments

Comments
 (0)