From: Dan Carpenter <dan.carpenter@linaro.org>
To: Gyeyoung Baek <gye976@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH next] iio: chemical: mhz19b: Fix error code in probe()
Date: Wed, 7 May 2025 15:59:00 +0300 [thread overview]
Message-ID: <aBtZFLFlr0slcYSi@stanley.mountain> (raw)
Return -ENOMEM if devm_iio_device_alloc() fails. Don't return success.
Fixes: b43278d66e99 ("iio: chemical: Add support for Winsen MHZ19B CO2 sensor")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/iio/chemical/mhz19b.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/chemical/mhz19b.c b/drivers/iio/chemical/mhz19b.c
index c0052ba3ac6c..3c64154918b1 100644
--- a/drivers/iio/chemical/mhz19b.c
+++ b/drivers/iio/chemical/mhz19b.c
@@ -276,7 +276,7 @@ static int mhz19b_probe(struct serdev_device *serdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
if (!indio_dev)
- return ret;
+ return -ENOMEM;
serdev_device_set_drvdata(serdev, indio_dev);
st = iio_priv(indio_dev);
--
2.47.2
next reply other threads:[~2025-05-07 12:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 12:59 Dan Carpenter [this message]
2025-05-07 13:34 ` [PATCH next] iio: chemical: mhz19b: Fix error code in probe() David Lechner
2025-05-07 15:55 ` Gyeyoung Baek
2025-05-08 19:08 ` 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=aBtZFLFlr0slcYSi@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gye976@gmail.com \
--cc=jic23@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox