[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1287972667.23608.2.camel@mola>
Date: Mon, 25 Oct 2010 10:11:07 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Liam Girdwood <lrg@...mlogic.co.uk>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>
Subject: [PATCH 1/2] regulator: max8952 - fix max8952_pmic_probe error path
Signed-off-by: Axel Lin <axel.lin@...il.com>
---
drivers/regulator/max8952.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c
index f2af0b1..7d6aacf 100644
--- a/drivers/regulator/max8952.c
+++ b/drivers/regulator/max8952.c
@@ -212,9 +212,11 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
max8952->rdev = regulator_register(®ulator, max8952->dev,
&pdata->reg_data, max8952);
- ret = IS_ERR(max8952->rdev);
- if (ret)
+ if (IS_ERR(max8952->rdev)) {
+ ret = PTR_ERR(max8952->rdev);
dev_err(max8952->dev, "regulator init failed (%d)\n", ret);
+ goto err_reg;
+ }
max8952->en = !!(pdata->reg_data.constraints.boot_on);
max8952->vid0 = (pdata->default_mode % 2) == 1;
@@ -309,6 +311,10 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
i2c_set_clientdata(client, max8952);
+ return 0;
+
+err_reg:
+ kfree(max8952);
return ret;
}
--
1.7.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists