lkml.org 
[lkml]   [2011]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/2] regulator: Fix the error handling if create_regulator fails
From
Date
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>
---
drivers/regulator/core.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dbdebed6..fb6ea9b 100644
--- 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++;
--
1.7.5.4




\
 
 \ /
  Last update: 2011-12-29 10:05    [W:0.030 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site