linux/drivers/pinctrl/stm32
Haotian Zhang 3dc8f5c195 pinctrl: stm32: fix hwspinlock resource leak in probe function
[ Upstream commit 002679f79e ]

In stm32_pctl_probe(), hwspin_lock_request_specific() is called to
request a hwspinlock, but the acquired lock is not freed on multiple
error paths after this call. This causes resource leakage when the
function fails to initialize properly.

Use devm_hwspin_lock_request_specific() instead of
hwspin_lock_request_specific() to automatically manage the hwspinlock
resource lifecycle.

Fixes: 97cfb6cd34 ("pinctrl: stm32: protect configuration registers with a hwspinlock")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-18 14:02:43 +01:00
..
Kconfig pinctrl: stm32: Introduce HDP driver 2025-07-14 17:50:58 +02:00
Makefile pinctrl: stm32: Introduce HDP driver 2025-07-14 17:50:58 +02:00
pinctrl-stm32-hdp.c Pin control changes for the v6.18 kernel cycle: 2025-10-01 13:14:48 -07:00
pinctrl-stm32.c pinctrl: stm32: fix hwspinlock resource leak in probe function 2025-12-18 14:02:43 +01:00
pinctrl-stm32.h pinctrl: stm32: Handle RSVD pin configuration 2025-06-18 11:23:57 +02:00
pinctrl-stm32f429.c pinctrl: stm32: Fix copyright 2017-12-02 16:23:08 +01:00
pinctrl-stm32f469.c pinctrl: stm32: Fix copyright 2017-12-02 16:23:08 +01:00
pinctrl-stm32f746.c pinctrl: stm32: Fix copyright 2017-12-02 16:23:08 +01:00
pinctrl-stm32f769.c pinctrl: stm32: add STM32F769 MCU support 2018-01-22 09:28:08 +01:00
pinctrl-stm32h743.c pinctrl: stm32: Fix copyright 2017-12-02 16:23:08 +01:00
pinctrl-stm32mp135.c pinctrl: stm32: prevent the use of the secure protected pins 2022-05-05 00:04:04 +02:00
pinctrl-stm32mp157.c pinctrl: stm32: improve bank clocks management 2022-05-01 23:25:58 +02:00
pinctrl-stm32mp257.c pinctrl: stm32: Allow compile as module for stm32mp257 2025-06-18 11:20:11 +02:00