diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-04-19 03:58:02 +0200 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-04-19 14:29:16 +0200 |
commit | 58d57658834faa0c19da35e84632f7b78846f69f (patch) | |
tree | 412243f269fbc8b151c19113e576660590b31711 /drivers/regulator/mc13783-regulator.c | |
parent | regulator: Let drivers know when they use the stub API (diff) | |
download | linux-58d57658834faa0c19da35e84632f7b78846f69f.tar.xz linux-58d57658834faa0c19da35e84632f7b78846f69f.zip |
mc13783-regulator: fix a memory leak in mc13783_regulator_remove
This patch fixes a memory leak by freeing priv in mc13783_regulator_remove
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/mc13783-regulator.c')
-rw-r--r-- | drivers/regulator/mc13783-regulator.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c index a681f5e8f786..ad036dd8da13 100644 --- a/drivers/regulator/mc13783-regulator.c +++ b/drivers/regulator/mc13783-regulator.c @@ -618,9 +618,12 @@ static int __devexit mc13783_regulator_remove(struct platform_device *pdev) dev_get_platdata(&pdev->dev); int i; + platform_set_drvdata(pdev, NULL); + for (i = 0; i < pdata->num_regulators; i++) regulator_unregister(priv->regulators[i]); + kfree(priv); return 0; } |