linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Jing Xiangfeng <jingxiangfeng@huawei.com>,
	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, jingxiangfeng@huawei.com
Subject: Re: [PATCH v2] clk: ti: clkctrl: fix the missed kfree() for _ti_omap4_clkctrl_setup()
Date: Wed, 14 Oct 2020 10:19:14 -0700	[thread overview]
Message-ID: <160269595458.884498.14663108408006981397@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20200728061846.68281-1-jingxiangfeng@huawei.com>

Quoting Jing Xiangfeng (2020-07-27 23:18:46)
> _ti_omap4_clkctrl_setup() misses to call kfree() in an error path. Jump
> to cleanup 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
> index 864c484bde1b..a562261eb061 100644
> --- a/drivers/clk/ti/clkctrl.c
> +++ b/drivers/clk/ti/clkctrl.c
> @@ -656,7 +656,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
>  
>                 hw = kzalloc(sizeof(*hw), GFP_KERNEL);
>                 if (!hw)
> -                       return;
> +                       goto cleanup;

Nobody reviewed this so I didn't apply it. I looked closer and it seems
that this may fix one leak but this is inside a while loop so presumably
we need to goto cleanup and unwind the loop of allocations? Put another
way, there is more work to do here.

      reply	other threads:[~2020-10-14 17:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28  6:18 [PATCH v2] clk: ti: clkctrl: fix the missed kfree() for _ti_omap4_clkctrl_setup() Jing Xiangfeng
2020-10-14 17:19 ` Stephen Boyd [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=160269595458.884498.14663108408006981397@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=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=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).