[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdUYFbWCK=SKDK8cKSsiYkorwfaeoO+cf=f2ERftLY=Yag@mail.gmail.com>
Date: Wed, 10 Sep 2025 11:27:47 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
Cc: chenyuan_fl@....com, geert+renesas@...der.be, mturquette@...libre.com,
sboyd@...nel.org, linux-renesas-soc@...r.kernel.org,
linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
Yuan CHen <chenyuan@...inos.cn>
Subject: Re: [PATCH v2] clk: renesas: fix memory leak in cpg_mssr_reserved_init()
On Mon, 8 Sept 2025 at 04:02, Kuninori Morimoto
<kuninori.morimoto.gx@...esas.com> wrote:
> > 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@...inos.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.
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
i.e. will queue in renesas-clk for v6.18, with the patch description
reworded.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists