提交 bcda4321 编写于 作者: A Axel Lin 提交者: Mark Brown

regulator: Fix the error handling if create_regulator fails

In the case of create_regulator() fails, goto the error path immediately.
It does not make sense to update rdev->open_count if create_regulator fails.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 a398eaa2
......@@ -1282,6 +1282,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
if (regulator == NULL) {
regulator = ERR_PTR(-ENOMEM);
module_put(rdev->owner);
goto out;
}
rdev->open_count++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册