Re: [PATCH] pinctrl: sophgo: fix double free in cv1800_pctrl_dt_node_to_map()

From: Linus Walleij
Date: Thu Oct 10 2024 - 15:20:01 EST


On Thu, Oct 10, 2024 at 1:24 PM Harshit Mogalapalli
<harshit.m.mogalapalli@xxxxxxxxxx> wrote:

> 'map' is allocated using devm_* which takes care of freeing the allocated
> data, but in error paths there is a call to pinctrl_utils_free_map()
> which also does kfree(map) which leads to a double free.
>
> Use kcalloc() instead of devm_kcalloc() as freeing is manually handled.
>
> Fixes: a29d8e93e710 ("pinctrl: sophgo: add support for CV1800B SoC")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>

Patch applied for fixes!

Yours,
Linus Walleij