From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Hangyu Hua <hbh25y@gmail.com>,
kristo@kernel.org, mturquette@baylibre.com, sboyd@kernel.org,
tony@atomide.com, dario.binacchi@amarulasolutions.com,
claudiu.beznea@microchip.com, robh@kernel.org,
andriy.shevchenko@linux.intel.com
Cc: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ti: fix possible memory leak in _ti_omap4_clkctrl_setup()
Date: Tue, 31 Oct 2023 09:24:59 +0200 [thread overview]
Message-ID: <48467507-877c-4789-85a9-932b0e79ed79@tuxon.dev> (raw)
In-Reply-To: <20231027025057.11510-1-hbh25y@gmail.com>
On 27.10.2023 05:50, Hangyu Hua wrote:
> kstrndup() and kstrdup_and_replace() in clkctrl_get_name() can perform
> dynamic memory allocation. So clkctrl_name() needs to be freed when
s/clkctrl_name()/clkctrl_name
> provider->clkdm_name is NULL.
>
> Fixes: bd46cd0b802d ("clk: ti: clkctrl: check return value of kasprintf()")
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
> ---
>
> v2: fix commit info.
>
> drivers/clk/ti/clkctrl.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
> index 607e34d8e289..cb4aa8a45bb2 100644
> --- a/drivers/clk/ti/clkctrl.c
> +++ b/drivers/clk/ti/clkctrl.c
> @@ -591,6 +591,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
> provider->clkdm_name = kasprintf(GFP_KERNEL,
> "%s_clkdm", clkctrl_name);
> if (!provider->clkdm_name) {
> + kfree(clkctrl_name);
> kfree(provider);
> return;
> }
prev parent reply other threads:[~2023-10-31 7:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-27 2:50 [PATCH v2] ti: fix possible memory leak in _ti_omap4_clkctrl_setup() Hangyu Hua
2023-10-31 7:24 ` claudiu beznea [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=48467507-877c-4789-85a9-932b0e79ed79@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=andriy.shevchenko@linux.intel.com \
--cc=claudiu.beznea@microchip.com \
--cc=dario.binacchi@amarulasolutions.com \
--cc=hbh25y@gmail.com \
--cc=kristo@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=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