public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: Valentin Ilie <valentin.ilie@gmail.com>,
	pankaj.dev@st.com, gabriel.fernandez@st.com
Cc: linux-kernel@vger.kernel.org, "Valentin Ilie" <valentin.ilie@gmail.com>
Subject: Re: [PATCH] clk: st: Fix memory leak
Date: Fri, 23 May 2014 15:13:59 -0700	[thread overview]
Message-ID: <20140523221359.23136.66960@quantum> (raw)
In-Reply-To: <1398172554-22053-1-git-send-email-valentin.ilie@gmail.com>

Quoting Valentin Ilie (2014-04-22 06:15:54)
> When it fails to allocate div, gate should be free'd before return
> 
> Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>

Taken into clk-fixes.

Regards,
Mike

> ---
>  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
> 

      parent reply	other threads:[~2014-05-23 22:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 13:15 [PATCH] clk: st: Fix memory leak Valentin Ilie
2014-05-06  9:29 ` Valentin Ilie
2014-05-06 12:32   ` Gabriel Fernandez
2014-05-21 12:46     ` Valentin Ilie
2014-05-23 22:13 ` Mike Turquette [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140523221359.23136.66960@quantum \
    --to=mturquette@linaro.org \
    --cc=gabriel.fernandez@st.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pankaj.dev@st.com \
    --cc=valentin.ilie@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox