未验证 提交 c957387c 编写于 作者: P Peng Wu 提交者: Mark Brown

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

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

Fixes: 27b9ecc7 ("regulator: Add of_regulator_bulk_get_all")
Signed-off-by: NPeng Wu <wupeng58@huawei.com>
Link: https://lore.kernel.org/r/20221122082242.82937-1-wupeng58@huawei.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 9211402f
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册