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: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Родитель
a398eaa23e
Коммит
bcda432194
|
@ -1282,6 +1282,7 @@ found:
|
||||||
if (regulator == NULL) {
|
if (regulator == NULL) {
|
||||||
regulator = ERR_PTR(-ENOMEM);
|
regulator = ERR_PTR(-ENOMEM);
|
||||||
module_put(rdev->owner);
|
module_put(rdev->owner);
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
rdev->open_count++;
|
rdev->open_count++;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче