]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()
authorZeng Heng <zengheng4@huawei.com>
Mon, 15 Apr 2024 10:53:28 +0000 (18:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 10:14:24 +0000 (12:14 +0200)
commitc7e02ccc9fdc496fe51e440e3e66ac36509ca049
treef7f1e32ccb7aa13d1cd471816c7a7bdf839aef38
parent946ab150335d92f852288c1c6b0f0466b5d6e97f
pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()

[ 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: 91d5c5060ee2 ("pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map")
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Message-ID: <20240415105328.3651441-1-zengheng4@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/devicetree.c