lkml.org 
[lkml]   [2015]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] clk: at91: clk-h32mxclk: fix memory leak
Hi David,

On Fri, 26 Jun 2015 14:33:27 +0200
David Dueck <davidcdueck@googlemail.com> wrote:

> Do not leak memory if clk_register fails.


Thanks for those fixes. Could you squash them in one single patch.
Once done you can add my

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Best Regards,

Boris

>
> 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);
> }



--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


\
 
 \ /
  Last update: 2015-06-26 15:41    [W:0.037 / U:0.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site