[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdaA8UQYX8bFeHn4JCxLgK_-UxR_n=ZCZmgbk8tqSgnFAw@mail.gmail.com>
Date: Tue, 24 Jun 2025 21:15:58 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Yuan Chen <chenyuan_fl@....com>
Cc: wens@...e.org, linux-gpio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
linux-kernel@...r.kernel.org, Yuan Chen <chenyuan@...inos.cn>
Subject: Re: [PATH v2] pinctrl: sunxi: Fix memory leak on krealloc failure in sunxi_pctrl_dt_node_to_map
On Fri, Jun 20, 2025 at 3:27 AM Yuan Chen <chenyuan_fl@....com> wrote:
> From: Yuan Chen <chenyuan@...inos.cn>
>
> In sunxi_pctrl_dt_node_to_map(), when krealloc() fails to resize the pinctrl_map
> array, the function returns -ENOMEM directly without freeing the previously
> allocated *map buffer. This results in a memory leak of the original kmalloc_array
> allocation.
>
> Fixes: e11dee2e98f8 ("pinctrl: sunxi: Deal with configless pins")
> Signed-off-by: Yuan Chen <chenyuan@...inos.cn>
Patch applied for fixes!
Yours,
Linus Walleij
Powered by blists - more mailing lists