Commit 0a044a9e authored by Zeng Heng's avatar Zeng Heng Committed by Zhang Zekun
Browse files

pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()

stable inclusion
from stable-v4.19.314
commit 06780473cb8a858d1d6cab2673e021b072a852d1
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IA8W1B

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=06780473cb8a858d1d6cab2673e021b072a852d1



----------------------------------------------------

[ Upstream commit a0cedbcc8852d6c77b00634b81e41f17f29d9404 ]

If we fail to allocate propname buffer, we need to drop the reference
count we just took. Because the pinctrl_dt_free_maps() includes the
droping operation, here we call it directly.

Fixes: 91d5c506 ("pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map")
Suggested-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Message-ID: <20240415105328.3651441-1-zengheng4@huawei.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZhang Zekun <zhangzekun11@huawei.com>
parent e4d814a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment