All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org, Crt Mori <cmo@melexis.com>
Cc: coverity-bot <keescook@chromium.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	coverity-bot <keescook+coverity-bot@chromium.org>
Subject: [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()
Date: Sat,  5 Nov 2022 12:51:07 +0000	[thread overview]
Message-ID: <20221105125108.383193-2-jic23@kernel.org> (raw)
In-Reply-To: <20221105125108.383193-1-jic23@kernel.org>

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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: c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/temperature/mlx90632.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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);
-- 
2.38.1


  reply	other threads:[~2022-11-05 12:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05 12:51 [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron
2022-11-05 12:51 ` Jonathan Cameron [this message]
2022-11-07  9:50   ` [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable() Crt Mori
2022-11-05 12:51 ` [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops Jonathan Cameron
2022-11-07  9:50   ` Crt Mori
2022-11-12 15:47 ` [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221105125108.383193-2-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=cmo@melexis.com \
    --cc=keescook+coverity-bot@chromium.org \
    --cc=keescook@chromium.org \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.