]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clocksource/drivers/ralink: Fix resource leaks in init error path
authorHaotian Zhang <vulab@iscas.ac.cn>
Thu, 30 Oct 2025 09:07:10 +0000 (17:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:19 +0000 (14:03 +0100)
commitcbc8d54c7313be21f82c252bda35e2ba36c3b4b4
treedeb6488d94adcc06186c20017e6691a7eddd50c2
parent0a3d0e94866352c9ecd75a50e361773ec06099f8
clocksource/drivers/ralink: Fix resource leaks in init error path

[ Upstream commit 2ba8e2aae1324704565a7d4d66f199d056c9e3c6 ]

The ralink_systick_init() function does not release all acquired resources
on its error paths. If irq_of_parse_and_map() or a subsequent call fails,
the previously created I/O memory mapping and IRQ mapping are leaked.

Add goto-based error handling labels to ensure that all allocated
resources are correctly freed.

Fixes: 1f2acc5a8a0a ("MIPS: ralink: Add support for systick timer found on newer ralink SoC")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/20251030090710.1603-1-vulab@iscas.ac.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clocksource/timer-ralink.c