Re: [PATCH 1/2] serial: lantiq: release the memory region in release_port

From: Arina Kharlamova

Date: Thu Dec 03 2026 - 06:23:23 EST


Hi John,

> The imbalance is there, but it only shows with TIOCSERCONFIG, which
> nobody runs on a SoC UART.
> I do not think this is stable material, please drop the Cc: stable.

Agreed, I will drop the Cc: stable if a v2 is needed, or the tag can be
dropped when applying.

On how it was found: it came from a static check, which is disclosed
under the cut, and I read the release_port and request_port paths to
confirm it before sending. You are right that the trigger is a root
ioctl that is not used on this hardware, so the patch is a cleanup of
an imbalance rather than a fix for something users hit.

Thanks,
Arina


> On 2 Dec 2026, at 00:01, John Crispin <john@xxxxxxxxxxx> wrote:
>
> This Message Is From an Untrusted Sender
> You have not previously corresponded with this sender.
> On 01.12.26 20:20, Arina Kharlamova via B4 Relay wrote:
> > From: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
> >
> > lqasc_request_port() requests the memory region with
> > devm_request_mem_region(), but lqasc_release_port() only unmaps the
> > registers. After TIOCSERCONFIG, which calls release_port and then
> > config_port, the region is still busy and lqasc_request_port() fails.
> > lqasc_config_port() ignores the error, and lqasc_startup() then
> > accesses the registers through a NULL membase.
> >
> > Release the region in lqasc_release_port().
> >
> > Fixes: 2f0fc4159a6a ("SERIAL: Lantiq: Add driver for MIPS Lantiq SOCs.")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
> > ---
> > drivers/tty/serial/lantiq.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
> > index fc75476c0935..37f74ecae937 100644
> > --- a/drivers/tty/serial/lantiq.c
> > +++ b/drivers/tty/serial/lantiq.c
> > @@ -498,11 +498,17 @@ static void
> > lqasc_release_port(struct uart_port *port)
> > {
> > struct platform_device *pdev = to_platform_device(port->dev);
> > + struct resource *res;
> >
> > if (port->flags & UPF_IOREMAP) {
> > devm_iounmap(&pdev->dev, port->membase);
> > port->membase = NULL;
> > }
> > +
> > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > + if (res)
> > + devm_release_mem_region(&pdev->dev, res->start,
> > + resource_size(res));
> > }
> >
> > static int
> >
>
> The imbalance is there, but it only shows with TIOCSERCONFIG, which nobody runs on a SoC UART.
>
> I do not think this is stable material, please drop the Cc: stable.
>
> this feels like some rogue / fire and forget LLM report material
>
>
>
>