Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270172

[PATCH] clk: versatile: fix memory leak

From Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] clk: versatile: fix memory leak
Date 2015-11-16 14:50 +0100
Message-ID <qvsks-7Yr-65@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] clk: versatile: fix memory leak Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-11-16 14:50 +0100
  Re: [PATCH] clk: versatile: fix memory leak Stephen Boyd <sboyd@codeaurora.org> - 2015-11-18 23:30 +0100
    Re: [PATCH] clk: versatile: fix memory leak Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-11-20 10:00 +0100
      Re: [PATCH] clk: versatile: fix memory leak Stephen Boyd <sboyd@codeaurora.org> - 2015-11-20 18:20 +0100

csiph-web