[PATCH 2/2] serial: pic32_uart: unmap the registers in release_port
From: Arina Kharlamova via B4 Relay
Date: Tue Dec 01 2026 - 14:20:40 EST
From: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
pic32_uart_request_port() maps the registers with devm_ioremap(), but
pic32_uart_release_port() only releases the memory region. The serial
core calls release_port and then config_port on every TIOCSERCONFIG,
so each call adds a mapping that stays until the driver is unbound.
Unmap the registers in pic32_uart_release_port().
Fixes: 157b9394709e ("serial: pic32_uart: Add PIC32 UART driver")
Signed-off-by: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
---
drivers/tty/serial/pic32_uart.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
index a645b646bf8d..9a0f5073d273 100644
--- a/drivers/tty/serial/pic32_uart.c
+++ b/drivers/tty/serial/pic32_uart.c
@@ -710,6 +710,8 @@ static void pic32_uart_release_port(struct uart_port *port)
return;
res_size = resource_size(res_mem);
+ devm_iounmap(port->dev, port->membase);
+ port->membase = NULL;
release_mem_region(port->mapbase, res_size);
}
--
Git-157)