From: Gabriel Fernandez <gabriel.fernandez@st.com>
To: Valentin Ilie <valentin.ilie@gmail.com>,
Mike Turquette <mturquette@linaro.org>, <pankaj.dev@st.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] clk: st: Fix memory leak
Date: Tue, 6 May 2014 14:32:05 +0200 [thread overview]
Message-ID: <5368D645.7030206@st.com> (raw)
In-Reply-To: <CAHuBVBZbLbAuVp3bwnWO45=9=irS8krPKiS905eC0K1Bgs4S9g@mail.gmail.com>
Hi Valentin
Thanks for the patch, i agree with it.
Mike do you planned to integrate this patch ?
Gabriel.
Best Regards.
On 05/06/2014 11:29 AM, Valentin Ilie wrote:
> On 22 April 2014 16:15, Valentin Ilie <valentin.ilie@gmail.com> wrote:
>> When it fails to allocate div, gate should be free'd before return
>>
>> Signed-off-by: Valentin Ilie <valentin.ilie@gmail.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?
>
next prev parent reply other threads:[~2014-05-06 12:32 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 [this message]
2014-05-21 12:46 ` Valentin Ilie
2014-05-23 22:13 ` Mike Turquette
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=5368D645.7030206@st.com \
--to=gabriel.fernandez@st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.