public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: versatile: fix memory leak
@ 2015-11-16 13:46 Sudip Mukherjee
  2015-11-18 22:24 ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2015-11-16 13:46 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk, Sudip Mukherjee

If of_clk_parent_fill() fails then we printed an error message and
returned. But we missed freeing sp810.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/clk/versatile/clk-sp810.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c
index a1cdef6..6a36c8b 100644
--- a/drivers/clk/versatile/clk-sp810.c
+++ b/drivers/clk/versatile/clk-sp810.c
@@ -102,6 +102,7 @@ static void __init clk_sp810_of_setup(struct device_node *node)
 
 	if (of_clk_parent_fill(node, parent_names, num) != num) {
 		pr_warn("Failed to obtain parent clocks for SP810!\n");
+		kfree(sp810);
 		return;
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-20 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-16 13:46 [PATCH] clk: versatile: fix memory leak Sudip Mukherjee
2015-11-18 22:24 ` Stephen Boyd
2015-11-20  8:58   ` Sudip Mukherjee
2015-11-20 17:17     ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox