summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-15 18:25:08 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-18 13:39:42 +0100
commit230a5a1c41464f7fe5b676c21280ae4effa222c8 (patch)
tree07cae8833ca0e83087a22ba5525159495436fc3b /drivers/regulator/core.c
parent8b96de31b0cf190fb6b21c4ab1ce310c430b72ae (diff)
downloadlinux-3.10-230a5a1c41464f7fe5b676c21280ae4effa222c8.tar.gz
linux-3.10-230a5a1c41464f7fe5b676c21280ae4effa222c8.tar.bz2
linux-3.10-230a5a1c41464f7fe5b676c21280ae4effa222c8.zip
regulator: Fix double free in devm_regulator_put()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 663ebd534ef..729b20d1c1d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1461,9 +1461,7 @@ void devm_regulator_put(struct regulator *regulator)
rc = devres_release(regulator->dev, devm_regulator_release,
devm_regulator_match, regulator);
- if (rc == 0)
- regulator_put(regulator);
- else
+ if (rc != 0)
WARN_ON(rc);
}
EXPORT_SYMBOL_GPL(devm_regulator_put);