aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-29 04:02:08 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-29 05:40:19 -0500
commitbcda432194fc7c4a2dbe9d7146f00b4b21e66c8c (patch)
tree24ac992ed9dc5768f3f890543b40d59a86ab06ed /drivers/regulator
parenta398eaa23e42b73216efbe03dc1d754b2e5d603c (diff)
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6f7d411b048b..6cb9d399affd 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1282,6 +1282,7 @@ found:
1282 if (regulator == NULL) { 1282 if (regulator == NULL) {
1283 regulator = ERR_PTR(-ENOMEM); 1283 regulator = ERR_PTR(-ENOMEM);
1284 module_put(rdev->owner); 1284 module_put(rdev->owner);
1285 goto out;
1285 } 1286 }
1286 1287
1287 rdev->open_count++; 1288 rdev->open_count++;