public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] clk: at91: clk-h32mxclk: fix memory leak
@ 2015-06-26 12:33 David Dueck
  2015-06-26 12:33 ` [PATCH 2/6] clk: at91: clk-main: " David Dueck
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: David Dueck @ 2015-06-26 12:33 UTC (permalink / raw)
  To: boris.brezillon; +Cc: mturquette, nicolas.ferre, sboyd, linux-clk, linux-kernel

Do not leak memory if clk_register fails.

Signed-off-by: David Dueck <davidcdueck@googlemail.com>
---
 drivers/clk/at91/clk-h32mx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c
index 152dcb3..61566bc 100644
--- a/drivers/clk/at91/clk-h32mx.c
+++ b/drivers/clk/at91/clk-h32mx.c
@@ -116,8 +116,10 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np,
 	h32mxclk->pmc = pmc;
 
 	clk = clk_register(NULL, &h32mxclk->hw);
-	if (!clk)
+	if (!clk) {
+		kfree(h32mxclk);
 		return;
+	}
 
 	of_clk_add_provider(np, of_clk_src_simple_get, clk);
 }
-- 
2.4.4


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

end of thread, other threads:[~2015-06-26 13:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-26 12:33 [PATCH 1/6] clk: at91: clk-h32mxclk: fix memory leak David Dueck
2015-06-26 12:33 ` [PATCH 2/6] clk: at91: clk-main: " David Dueck
2015-06-26 12:33 ` [PATCH 3/6] clk: at91: clk-master: fix error path David Dueck
2015-06-26 12:33 ` [PATCH 4/6] clk: at91: clk-pll: " David Dueck
2015-06-26 12:33 ` [PATCH 5/6] clk: at91: clk-system: " David Dueck
2015-06-26 12:33 ` [PATCH 6/6] clk: at91: clk-utmi: " David Dueck
2015-06-26 13:12 ` [PATCH 1/6] clk: at91: clk-h32mxclk: fix memory leak Boris Brezillon

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