[PATCH] clkdev: Fix leak in devm_clk_put()

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Jun 5 06:44:45 EDT 2012


Surprisingly devres_destroy() doesn't call the destructor for the resource
it is destroying, causing devm_clk_put() to be ineffectual.

Use the newly added devres_release() instead to fix this.

Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
---
 drivers/clk/clkdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index c535cf8..c7a4eee 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -133,7 +133,7 @@ void devm_clk_put(struct device *dev, struct clk *clk)
 {
 	int ret;
 
-	ret = devres_destroy(dev, devm_clk_release, devm_clk_match, clk);
+	ret = devres_release(dev, devm_clk_release, devm_clk_match, clk);
 
 	WARN_ON(ret);
 }
-- 
1.7.10




More information about the linux-arm-kernel mailing list