Re: [PATCH] pinctrl: berlin: fix memory leak in berlin_pinctrl_build_state()
From: Linus Walleij
Date: Tue Jun 24 2025 - 15:18:38 EST
On Fri, Jun 20, 2025 at 3:53 AM Yuan Chen <chenyuan_fl@xxxxxxx> wrote:
> From: Yuan Chen <chenyuan@xxxxxxxxxx>
>
> In the original implementation, krealloc() failure handling incorrectly
> assigned the original memory pointer to NULL after kfree(), causing a
> memory leak when reallocation failed.
>
> Fixes: de845036f997 ("pinctrl: berlin: fix error return code of berlin_pinctrl_build_state()")
> Signed-off-by: Yuan Chen <chenyuan@xxxxxxxxxx>
Patch applied!
Yours,
Linus Walleij