From: Markus Elfring <Markus.Elfring@web.de>
To: Jing Xiangfeng <jingxiangfeng@huawei.com>,
linux-clk@vger.kernel.org, linux-omap@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Michael Turquette <mturquette@baylibre.com>,
Rob Herring <robh@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
Tero Kristo <t-kristo@ti.com>, Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH] clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup()
Date: Mon, 20 Jul 2020 16:19:06 +0200 [thread overview]
Message-ID: <b7f0dcda-7ec8-b3d8-ba53-c2720799abbc@web.de> (raw)
…
> +++ 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;
> + }
…
I suggest to use an additional label instead.
if (!hw)
- return;
+ goto free_control_name;
By the way:
How do you think about to replace the label “cleanup” by other jump targets
for better exception handling in this function implementation?
Regards,
Markus
next reply other threads:[~2020-07-20 14:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 14:19 Markus Elfring [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-20 14:19 [PATCH] clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup() Markus Elfring
2020-07-20 12:23 Jing Xiangfeng
2020-07-28 1:24 ` Stephen Boyd
2020-07-28 3:43 ` Jing Xiangfeng
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=b7f0dcda-7ec8-b3d8-ba53-c2720799abbc@web.de \
--to=markus.elfring@web.de \
--cc=jingxiangfeng@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).