public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Éric Piel" <eric.piel@tremplin-utc.net>
To: unlisted-recipients:; (no To-header on input)
Cc: Ilkka Koskinen <ilkka.koskinen@nokia.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 07/10] lis3: Free regulators if probe() fails.
Date: Mon, 25 Jul 2011 17:21:53 +0200	[thread overview]
Message-ID: <4E2D8A11.4020809@tremplin-utc.net> (raw)
In-Reply-To: <4E2D8858.8000900@tremplin-utc.net>

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
---
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
index b20dfb4..ea9159c 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
@@ -161,8 +161,13 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
 	if (lis3_dev.reg_ctrl)
 		lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF);
 
-	if (ret == 0)
-		return 0;
+	if (ret)
+		goto fail2;
+	return 0;
+
+fail2:
+	regulator_bulk_free(ARRAY_SIZE(lis3_dev.regulators),
+				lis3_dev.regulators);
 fail:
 	if (pdata && pdata->release_resources)
 		pdata->release_resources();
-- 
1.7.6


  parent reply	other threads:[~2011-07-25 15:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25 15:14 [PATCH 00/10] lis3: various fixes and enhancements Éric Piel
2011-07-25 15:16 ` [PATCH 01/10] lis3lv02d: avoid divide by zero due to unchecked Éric Piel
2011-08-01 20:29   ` Andrew Morton
2011-08-01 21:11     ` Christian Lamparter
2011-08-01 21:29       ` Andrew Morton
2011-08-03 13:21         ` Éric Piel
2011-07-25 15:17 ` [PATCH 02/10] lis3: update maintainer information Éric Piel
2011-07-25 15:18 ` [PATCH 03/10] lis3: add support for HP EliteBook 2730p Éric Piel
2011-07-25 15:19 ` [PATCH 04/10] lis3: add support for HP EliteBook 8540w Éric Piel
2011-07-25 15:19 ` [PATCH 05/10] hp_accel: Add HP ProBook 655x Éric Piel
2011-07-25 15:20 ` [PATCH 06/10] CONFIG_HP_ACCEL: Fix help text Éric Piel
2011-07-25 15:21 ` Éric Piel [this message]
2011-07-25 15:22 ` [PATCH 08/10] lis3: Change naming to consistent Éric Piel
2011-07-25 15:23 ` [PATCH 09/10] lis3: Change exported function to use given Éric Piel
2011-07-25 15:24 ` [PATCH 10/10] lis3: Remove the references to the global variable in core driver Éric Piel
2011-08-03 13:47   ` [PATCH 10/10 v2] " Éric Piel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E2D8A11.4020809@tremplin-utc.net \
    --to=eric.piel@tremplin-utc.net \
    --cc=akpm@linux-foundation.org \
    --cc=ilkka.koskinen@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox