[PATCH] serial: 8250_aspeed_vuart: shut down the unthrottle timer on removal
From: Myeonghun Pak
Date: Thu Nov 12 2026 - 02:08:00 EST
aspeed_vuart_remove() deletes unthrottle_timer while the port IRQ is
still active. An interrupt can re-arm the timer before port shutdown,
allowing its callback to access freed driver data.
Use timer_shutdown_sync() to prevent rearming. Keep it before
serial8250_unregister_port(), which releases the register mapping
used by the callback.
Found by a static analysis tool under development.
Compile-tested with W=1 for arm64 and x86_64.
Not tested on hardware.
Fixes: 5909c0bf9c7a ("serial/aspeed-vuart: Implement quick throttle mechanism")
Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
---
drivers/tty/serial/8250/8250_aspeed_vuart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c
index 452bef82bec2..0776675b8382 100644
--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c
+++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c
@@ -552,7 +552,7 @@ static void aspeed_vuart_remove(struct platform_device *pdev)
{
struct aspeed_vuart *vuart = platform_get_drvdata(pdev);
- timer_delete_sync(&vuart->unthrottle_timer);
+ timer_shutdown_sync(&vuart->unthrottle_timer);
aspeed_vuart_set_enabled(vuart, false);
serial8250_unregister_port(vuart->port);
sysfs_remove_group(&vuart->dev->kobj, &aspeed_vuart_attr_group);
base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47
--
2.43.0