Re: [PATCH v2] clk: renesas: fix memory leak in cpg_mssr_reserved_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 8 Sept 2025 at 04:02, Kuninori Morimoto
<kuninori.morimoto.gx@xxxxxxxxxxx> 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@xxxxxxxxxx>
>
> 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@xxxxxxxxx>
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@xxxxxxxxxxxxxx

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




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux