From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: chenyuan_fl@163.com
Cc: geert+renesas@glider.be, mturquette@baylibre.com,
sboyd@kernel.org, linux-renesas-soc@vger.kernel.org,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Yuan CHen <chenyuan@kylinos.cn>
Subject: Re: [PATCH v2] clk: renesas: fix memory leak in cpg_mssr_reserved_init()
Date: Mon, 8 Sep 2025 02:02:39 +0000 [thread overview]
Message-ID: <87ms751z28.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <20250908012810.4767-1-chenyuan_fl@163.com>
Hi chenyuan
Thank you for the patch
> In the current implementation, when krealloc_array() fails, the error handling path
> incorrectly sets the original memory pointer to NULL before it is freed,
> resulting in a memory leak during reallocation failure.
>
> Fixes: 6aa17547649 ("clk: renesas: cpg-mssr: Ignore all clocks assigned to non-Linux system")
> Signed-off-by: Yuan CHen <chenyuan@kylinos.cn>
You want to use ${LINUX}/scripts/checkpatch.pl to get maximum 75 chars warning
Patch itself is agree, but I still don't understand the git-log.
incorrectly sets the original memory pointer to NULL before it is freed,
I still don't understand this part. which part are you talking about ?
What does this "original memory pointer" mean ? And what does this "freed"
mean ? freed what ??
I guess you want to indicate is like this ?
In case of krealloc_array() failure, current error handling just
returns from function without freeing alloced array.
It cause a memory leak. Fixup it.
Thank you for your help !!
Best regards
---
Kuninori Morimoto
next prev parent reply other threads:[~2025-09-08 2:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 1:57 [PATCH] clk: renesas: fix memory leak in cpg_mssr_reserved_init() chenyuan_fl
2025-09-07 23:50 ` Kuninori Morimoto
2025-09-08 1:28 ` [PATCH v2] " chenyuan_fl
2025-09-08 2:02 ` Kuninori Morimoto [this message]
2025-09-10 9:27 ` Geert Uytterhoeven
2025-09-15 13:12 ` [PATCH] " chenyuan_fl
2025-09-15 23:51 ` Kuninori Morimoto
2025-09-15 23:56 ` Kuninori Morimoto
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=87ms751z28.wl-kuninori.morimoto.gx@renesas.com \
--to=kuninori.morimoto.gx@renesas.com \
--cc=chenyuan@kylinos.cn \
--cc=chenyuan_fl@163.com \
--cc=geert+renesas@glider.be \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/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