lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 6 May 2014 12:29:29 +0300
From:	Valentin Ilie <valentin.ilie@...il.com>
To:	Mike Turquette <mturquette@...aro.org>, pankaj.dev@...com,
	gabriel.fernandez@...com
Cc:	linux-kernel@...r.kernel.org,
	Valentin Ilie <valentin.ilie@...il.com>
Subject: Re: [PATCH] clk: st: Fix memory leak

On 22 April 2014 16:15, Valentin Ilie <valentin.ilie@...il.com> wrote:
> When it fails to allocate div, gate should be free'd before return
>
> Signed-off-by: Valentin Ilie <valentin.ilie@...il.com>
> ---
>  drivers/clk/st/clkgen-pll.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
> index bca0a0b..a886702 100644
> --- a/drivers/clk/st/clkgen-pll.c
> +++ b/drivers/clk/st/clkgen-pll.c
> @@ -521,8 +521,10 @@ static struct clk * __init clkgen_odf_register(const char *parent_name,
>         gate->lock = odf_lock;
>
>         div = kzalloc(sizeof(*div), GFP_KERNEL);
> -       if (!div)
> +       if (!div) {
> +               kfree(gate);
>                 return ERR_PTR(-ENOMEM);
> +       }
>
>         div->flags = CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO;
>         div->reg = reg + pll_data->odf[odf].offset;
> --
> 1.8.3.2
>

Can someone look into this?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ