projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9211402
)
regulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()
author
Peng Wu
<wupeng58@huawei.com>
Tue, 22 Nov 2022 08:22:42 +0000
(08:22 +0000)
committer
Mark Brown
<broonie@kernel.org>
Tue, 22 Nov 2022 17:05:05 +0000
(17:05 +0000)
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>
Link:
https://lore.kernel.org/r/20221122082242.82937-1-wupeng58@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/of_regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/of_regulator.c
b/drivers/regulator/of_regulator.c
index 584c92f1a317c6a6c6e35c39ba3f696fe3286b3b..f7529f1bf8b2e996153ed9601144d60524f12deb 100644
(file)
--- a/
drivers/regulator/of_regulator.c
+++ b/
drivers/regulator/of_regulator.c
@@
-767,7
+767,7
@@
restart:
memcpy(name, prop->name, i);
name[i] = '\0';
tmp = regulator_get(dev, name);
- if (
!tmp
) {
+ if (
IS_ERR(tmp)
) {
ret = -EINVAL;
goto error;
}