Commit e3507c56 authored by Yuan Chen's avatar Yuan Chen Committed by Linus Walleij
Browse files

pinctrl: sunxi: Fix memory leak on krealloc failure



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: e11dee2e ("pinctrl: sunxi: Deal with configless pins")
Signed-off-by: default avatarYuan Chen <chenyuan@kylinos.cn>
Link: https://lore.kernel.org/20250620012708.16709-1-chenyuan_fl@163.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent b4102e35
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment