From: Peng Wu <wupeng58@huawei.com>
To: <lgirdwood@gmail.com>, <broonie@kernel.org>, <clabbe@baylibre.com>
Cc: <linux-kernel@vger.kernel.org>, <liwei391@huawei.com>,
Peng Wu <wupeng58@huawei.com>
Subject: [PATCH -next] iregulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()
Date: Tue, 22 Nov 2022 08:22:42 +0000 [thread overview]
Message-ID: <20221122082242.82937-1-wupeng58@huawei.com> (raw)
The regulator_get() function never returns NULL. It returns error pointers.
Fixes: 27b9ecc7a9ba ("regulator: Add of_regulator_bulk_get_all")
Signed-off-by: Peng Wu <wupeng58@huawei.com>
---
drivers/regulator/of_regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 584c92f1a317..f7529f1bf8b2 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -767,7 +767,7 @@ int of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
memcpy(name, prop->name, i);
name[i] = '\0';
tmp = regulator_get(dev, name);
- if (!tmp) {
+ if (IS_ERR(tmp)) {
ret = -EINVAL;
goto error;
}
--
2.17.1
next reply other threads:[~2022-11-22 8:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 8:22 Peng Wu [this message]
2022-11-22 19:10 ` Mark Brown
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=20221122082242.82937-1-wupeng58@huawei.com \
--to=wupeng58@huawei.com \
--cc=broonie@kernel.org \
--cc=clabbe@baylibre.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liwei391@huawei.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
all inboxes | Powered by JetHome®