regulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()

commit c957387c40 upstream.

The regulator_get() function never returns NULL. It returns error pointers.

Fixes: 27b9ecc7a9 ("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>
This commit is contained in:
Peng Wu
2022-11-22 08:22:42 +00:00
committed by Greg Kroah-Hartman
parent 56fd70f4aa
commit 81eb07e299

View File

@@ -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;
}