summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Wu <wupeng58@huawei.com>2022-11-22 08:22:42 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-12 11:10:29 +0200
commit81eb07e299a5ad59c61f6192690b8cadd3ed3604 (patch)
tree0b634cca4e587d0128f0014e5574a3cedbbd6aad
parent56fd70f4aa8b82199dbe7e99366b1fd7a04d86fb (diff)
regulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()
commit c957387c402a1a213102e38f92b800d7909a728d upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/regulator/of_regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index c3571781a8cc..1b65e5e4e40f 100644
--- 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;
}