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)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 16 Apr 2024 13:32:48 +0000 (15:32 +0200)
commita0cedbcc8852d6c77b00634b81e41f17f29d9404
treec9d9f08034685bb809c28f743bab86fb363c3067
parentc5d3b64c568a344e998830e0e94a7c04e372f89b
pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()

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>
drivers/pinctrl/devicetree.c