Linux clock framework development
 help / color / mirror / Atom feed
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] clk: renesas: fix memory leak in cpg_mssr_reserved_init()
Date: Sun, 7 Sep 2025 23:50:40 +0000	[thread overview]
Message-ID: <87segx256a.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <20250905015735.10347-1-chenyuan_fl@163.com>


Hi chenyuan

Thank you for your patch

> In the current implementation, when krealloc_array() fails, the original memory
> pointer is incorrectly set to NULL after kfree(), 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>

Basically, I can agree that current code has memory leak issue.

But what does "the original memory pointer is incorrectly set to NULL after
kfree()," mean ? I guess git-log needs update ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto

  reply	other threads:[~2025-09-07 23:50 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 [this message]
2025-09-08  1:28   ` [PATCH v2] " chenyuan_fl
2025-09-08  2:02     ` Kuninori Morimoto
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=87segx256a.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