]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 26 Nov 2025 10:24:34 +0000 (11:24 +0100)
commit2ba8e2aae1324704565a7d4d66f199d056c9e3c6
treed5c0836c623d0ba9b306412b7a02baa106093b12
parent640594a04f119338019b0aeed70c7301216595b3
clocksource/drivers/ralink: Fix resource leaks in init error path

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
drivers/clocksource/timer-ralink.c