提交 968c2c17 编写于 作者: M Mark Brown

regulator: Actually free the regulator in devm_regulator_put()

It turns out that (quite surprisingly) devres_destroy() only undoes the
devres mapping, it doesn't destroy the underlying resource, meaning that
anything using devm_regulator_put() would leak. While we wait for the new
devres_release() which does what we want to get merged open code it in
devm_regulator_put().
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: NLiam Girdwood <lrg@ti.com>
上级 f55205f4
...@@ -1431,7 +1431,10 @@ void devm_regulator_put(struct regulator *regulator) ...@@ -1431,7 +1431,10 @@ void devm_regulator_put(struct regulator *regulator)
rc = devres_destroy(regulator->dev, devm_regulator_release, rc = devres_destroy(regulator->dev, devm_regulator_release,
devm_regulator_match, regulator); devm_regulator_match, regulator);
WARN_ON(rc); if (rc == 0)
regulator_put(regulator);
else
WARN_ON(rc);
} }
EXPORT_SYMBOL_GPL(devm_regulator_put); EXPORT_SYMBOL_GPL(devm_regulator_put);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册