[PATCH] clk: ti: dra7-atl-clock: fix a memory leak

Tero Kristo t-kristo at ti.com
Fri Sep 12 06:39:07 PDT 2014


of_clk_add_provider makes an internal copy of the parent_names property
while its called, thus it is no longer needed after this call and can
be freed.

Signed-off-by: Tero Kristo <t-kristo at ti.com>
Cc: Mike Turquette <mturquette at linaro.org>
Cc: Peter Ujfalusi <peter.ujfalusi at ti.com>
---
 drivers/clk/ti/clk-dra7-atl.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
index 4a65b41..3f9308a 100644
--- a/drivers/clk/ti/clk-dra7-atl.c
+++ b/drivers/clk/ti/clk-dra7-atl.c
@@ -199,6 +199,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
 
 	if (!IS_ERR(clk)) {
 		of_clk_add_provider(node, of_clk_src_simple_get, clk);
+		kfree(parent_names);
 		return;
 	}
 cleanup:
-- 
1.7.9.5




More information about the linux-arm-kernel mailing list