linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] clk/zynq: Fix possible memory leak
@ 2013-10-07  0:55 Felipe Pena
  2013-10-07  2:10 ` Baruch Siach
  2013-10-07 16:05 ` Sören Brinkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Felipe Pena @ 2013-10-07  0:55 UTC (permalink / raw)
  To: linux-arm-kernel

The zynq_clk_register_fclk function can leak memory (fclk_lock) when unable 
to alloc memory for fclk_gate_lock

Signed-off-by: Felipe Pena <felipensp@gmail.com>
---
 drivers/clk/zynq/clkc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c
index cc40fe6..7ea4b5c 100644
--- a/drivers/clk/zynq/clkc.c
+++ b/drivers/clk/zynq/clkc.c
@@ -117,6 +117,7 @@ static void __init zynq_clk_register_fclk(enum zynq_clk fclk,
 		goto err;
 	fclk_gate_lock = kmalloc(sizeof(*fclk_gate_lock), GFP_KERNEL);
 	if (!fclk_gate_lock)
+		kfree(fclk_lock);
 		goto err;
 	spin_lock_init(fclk_lock);
 	spin_lock_init(fclk_gate_lock);
-- 
1.7.10.4

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

end of thread, other threads:[~2013-10-07 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07  0:55 [PATCH 1/1] clk/zynq: Fix possible memory leak Felipe Pena
2013-10-07  2:10 ` Baruch Siach
2013-10-07 16:05 ` Sören Brinkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).