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


Groups > linux.kernel > #1270172 > unrolled thread

[PATCH] clk: versatile: fix memory leak

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2015-11-16 14:50 +0100
Last post2015-11-20 18:20 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1270172 — [PATCH] clk: versatile: fix memory leak

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-11-16 14:50 +0100
Subject[PATCH] clk: versatile: fix memory leak
Message-ID<qvsks-7Yr-65@gated-at.bofh.it>
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/

[toc] | [next] | [standalone]


#1272629

FromStephen Boyd <sboyd@codeaurora.org>
Date2015-11-18 23:30 +0100
Message-ID<qwjoJ-O1-9@gated-at.bofh.it>
In reply to#1270172
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
--
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/

[toc] | [prev] | [next] | [standalone]


#1273871

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-11-20 10:00 +0100
Message-ID<qwPI0-4To-45@gated-at.bofh.it>
In reply to#1272629
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
--
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/

[toc] | [prev] | [next] | [standalone]


#1274285

FromStephen Boyd <sboyd@codeaurora.org>
Date2015-11-20 18:20 +0100
Message-ID<qwXvP-1JB-11@gated-at.bofh.it>
In reply to#1273871
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
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web