linux-kernel.vger.kernel.org archive mirror
 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

* Re: [PATCH] clk: versatile: fix memory leak
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2015-11-18 22:24 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Michael Turquette, linux-kernel, linux-clk

On 11/16, Sudip Mukherjee wrote:
> 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>
> ---

Applied to clk-next

We don't need that error message on allocation failure either.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH] clk: versatile: fix memory leak
  2015-11-18 22:24 ` Stephen Boyd
@ 2015-11-20  8:58   ` Sudip Mukherjee
  2015-11-20 17:17     ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2015-11-20  8:58 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Michael Turquette, linux-kernel, linux-clk

On Wed, Nov 18, 2015 at 02:24:46PM -0800, Stephen Boyd wrote:
> On 11/16, Sudip Mukherjee wrote:
> > 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>
> > ---
> 
> Applied to clk-next

Thanks.
> 
> We don't need that error message on allocation failure either.

I sent another patch to remove the error message on kzalloc failure. Did
you mean that one or did you mean the error message for
of_clk_parent_fill()?
I could not find any message being printed if of_clk_parent_fill() fails
so kept it as it is.

regards
sudip

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

* Re: [PATCH] clk: versatile: fix memory leak
  2015-11-20  8:58   ` Sudip Mukherjee
@ 2015-11-20 17:17     ` Stephen Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2015-11-20 17:17 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Michael Turquette, linux-kernel, linux-clk

On 11/20, Sudip Mukherjee wrote:
> On Wed, Nov 18, 2015 at 02:24:46PM -0800, Stephen Boyd wrote:
> > On 11/16, Sudip Mukherjee wrote:
> > > 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>
> > > ---
> > 
> > Applied to clk-next
> 
> Thanks.
> > 
> > We don't need that error message on allocation failure either.
> 
> I sent another patch to remove the error message on kzalloc failure. Did
> you mean that one or did you mean the error message for
> of_clk_parent_fill()?

Yes I meant the one you removed. Thanks.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[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;
as well as URLs for NNTP newsgroup(s).