public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: Fix the error handling if create_regulator fails
@ 2011-12-29  9:02 Axel Lin
  2011-12-29  9:03 ` [PATCH 2/2] regulator: Fix checking return value of create_regulator Axel Lin
  2011-12-29 10:44 ` [PATCH 1/2] regulator: Fix the error handling if create_regulator fails Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2011-12-29  9:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown

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




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-29 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29  9:02 [PATCH 1/2] regulator: Fix the error handling if create_regulator fails Axel Lin
2011-12-29  9:03 ` [PATCH 2/2] regulator: Fix checking return value of create_regulator Axel Lin
2011-12-29 10:44 ` [PATCH 1/2] regulator: Fix the error handling if create_regulator fails Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox