[PATCH 0/2] serial: release the port resources in release_port

From: Arina Kharlamova via B4 Relay

Date: Tue Dec 01 2026 - 14:20:48 EST


lantiq and pic32_uart get their port resources with devm in
request_port and do not release all of them in release_port. On lantiq
TIOCSERCONFIG then ends in a NULL pointer access, on pic32 each
TIOCSERCONFIG leaks a mapping.

I found this with spec2patch. I model-checked the probe and remove paths
of the driver with CBMC against formal specifications of the kernel APIs
it calls. The specifications are checked against the kernel source, and
some of them are proved in Rocq against a transcription of the kernel
code. I also checked lock usage separately. With the help of an AI
coding assistant (Claude); I reviewed the analysis and the fix.
Compile-tested only, not tested on hardware.

To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
Arina Kharlamova (2):
serial: lantiq: release the memory region in release_port
serial: pic32_uart: unmap the registers in release_port

drivers/tty/serial/lantiq.c | 6 ++++++
drivers/tty/serial/pic32_uart.c | 2 ++
2 files changed, 8 insertions(+)
---
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
change-id: 20261201-s2p-lpr-tty-49d26c5fa81d

Best regards,
--
Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>