All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jing Xiangfeng <jingxiangfeng@huawei.com>
To: Stephen Boyd <sboyd@kernel.org>, <mturquette@baylibre.com>,
	<robh@kernel.org>, <t-kristo@ti.com>, <tony@atomide.com>
Cc: <linux-omap@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup()
Date: Tue, 28 Jul 2020 11:43:52 +0800	[thread overview]
Message-ID: <5F1F9EF8.6090304@huawei.com> (raw)
In-Reply-To: <159589945839.1360974.1977401781355555451@swboyd.mtv.corp.google.com>



On 2020/7/28 9:24, Stephen Boyd wrote:
> Quoting Jing Xiangfeng (2020-07-20 05:23:43)
>> _ti_omap4_clkctrl_setup() misses to call kfree() in an error path. Add
>> the missed function call to fix it.
>>
>> Fixes: 6c3090520554 ("clk: ti: clkctrl: Fix hidden dependency to node name")
>> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
>> ---
>>   drivers/clk/ti/clkctrl.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
>> index 864c484bde1b..868e50132c21 100644
>> --- a/drivers/clk/ti/clkctrl.c
>> +++ b/drivers/clk/ti/clkctrl.c
>> @@ -655,8 +655,10 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
>>                  }
>>
>>                  hw = kzalloc(sizeof(*hw), GFP_KERNEL);
>> -               if (!hw)
>> +               if (!hw) {
>> +                       kfree(clkctrl_name);
>>                          return;
>> +               }
>
> Why not goto cleanup?

Thanks, I will change it as you suggested.

>
>>
>>                  hw->enable_reg.ptr = provider->base + reg_data->offset;
>>
>> --
>> 2.17.1
>>
> .
>

  reply	other threads:[~2020-07-28  3:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 12:23 [PATCH] clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup() Jing Xiangfeng
2020-07-28  1:24 ` Stephen Boyd
2020-07-28  3:43   ` Jing Xiangfeng [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-20 14:19 Markus Elfring
2020-07-20 14:19 ` Markus Elfring
2020-07-20 14:19 ` Markus Elfring
2020-07-20 14:19   ` Markus Elfring

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=5F1F9EF8.6090304@huawei.com \
    --to=jingxiangfeng@huawei.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.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.