projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a398eaa
)
regulator: Fix the error handling if create_regulator fails
author
Axel Lin
<axel.lin@gmail.com>
Thu, 29 Dec 2011 09:02:08 +0000
(17:02 +0800)
committer
Mark Brown
<broonie@opensource.wolfsonmicro.com>
Thu, 29 Dec 2011 10:40:19 +0000
(10:40 +0000)
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>
drivers/regulator/core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/regulator/core.c
b/drivers/regulator/core.c
index 6f7d411b048b4e677a5885fdeb4311b345eb17c0..6cb9d399affdd587d97323b6c0ca1889abfb3ed8 100644
(file)
--- a/
drivers/regulator/core.c
+++ b/
drivers/regulator/core.c
@@
-1282,6
+1282,7
@@
found:
if (regulator == NULL) {
regulator = ERR_PTR(-ENOMEM);
module_put(rdev->owner);
+ goto out;
}
rdev->open_count++;