summaryrefslogtreecommitdiff
path: root/drivers/iio/temperature
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-11-05 12:51:07 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-11-23 19:57:12 +0000
commitbcf22afd2ce0b8bd4fad50bfda92e8cbbc483c72 (patch)
treebca6d2b66634e4c46441602d15f1335967aa7e13 /drivers/iio/temperature
parent6f7cadcf664b04df3b2e9b9c6d65bf626aa1b411 (diff)
downloadlwn-bcf22afd2ce0b8bd4fad50bfda92e8cbbc483c72.tar.gz
lwn-bcf22afd2ce0b8bd4fad50bfda92e8cbbc483c72.zip
iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()
This call can fail so handling is necessary even if it is very unlikely. Reported-by: coverity-bot <keescook+coverity-bot@chromium.org> Addresses-Coverity-ID: 1527134 ("Error handling issues") Fixes: 2aebc223fc7c ("iio: temperature: mlx90632 Add runtime powermanagement modes") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-off-by: Crt Mori <cmo@melexis.com> Link: https://lore.kernel.org/r/20221105125108.383193-2-jic23@kernel.org
Diffstat (limited to 'drivers/iio/temperature')
-rw-r--r--drivers/iio/temperature/mlx90632.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
index a17fe5f4967a..7572ae3f8432 100644
--- a/drivers/iio/temperature/mlx90632.c
+++ b/drivers/iio/temperature/mlx90632.c
@@ -1267,7 +1267,10 @@ static int mlx90632_probe(struct i2c_client *client,
pm_runtime_get_noresume(&client->dev);
pm_runtime_set_active(&client->dev);
- devm_pm_runtime_enable(&client->dev);
+ ret = devm_pm_runtime_enable(&client->dev);
+ if (ret)
+ return ret;
+
pm_runtime_set_autosuspend_delay(&client->dev, MLX90632_SLEEP_DELAY_MS);
pm_runtime_use_autosuspend(&client->dev);
pm_runtime_put_autosuspend(&client->dev);