regulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()
commitc957387c40upstream. 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:
committed by
Greg Kroah-Hartman
parent
56fd70f4aa
commit
81eb07e299
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user