Commit 1a6a558c authored by Yuan Chen's avatar Yuan Chen Committed by Greg Kroah-Hartman
Browse files

pinctrl: sunxi: Fix memory leak on krealloc failure



[ Upstream commit e3507c56 ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f19d1e26
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment