FAILED: patch "[PATCH] serial: 8250_omap: set priv->line before enabling the IRQ" failed to apply to 6.12-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 8276a44f0a0b68c07b2331cc0058036ac4c4190d
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 8276a44f0a0b68c07b2331cc0058036ac4c4190d Mon Sep 17 00:00:00 2001
From: "Jiri Slaby (SUSE)" <[email protected]>
Date: Tue, 13 Oct 2026 08:48:50 +0200
Subject: [PATCH] serial: 8250_omap: set priv->line before enabling the IRQ
omap8250_irq() is requested in omap8250_probe() with IRQ_NOAUTOEN and enabled only in omap_8250_startup(). The handler obtains the port by serial8250_get_port(priv->line), but probe stores priv->line only after serial8250_register_8250_port() returns.
The port becomes visible to userspace already inside serial8250_register_8250_port() (uart_add_one_port()). So it can be opened -- and the IRQ enabled -- before probe stores the line. An interrupt in that window makes the handler call serial8250_get_port(-ENODEV) and dereference a pointer outside of serial8250_ports[].
Store the line in omap_8250_startup() before enable_irq(), so the handler never runs with an unset line. Keep the assignment in probe too, as remove and the system PM callbacks rely on it even when the port was never opened.
--- drivers/tty/serial/8250/8250_omap.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/8250/8250_omap.c +3 -0
@@ -711,6 +711,9 @@ static int omap_8250_startup(struct uart_port *port)struct uart_8250_dma *dma = &priv->omap8250_dma;int ret; +/* ISR and runtime PM need the line; probe sets it only after registration */ + priv->line = port->line; +#ifdef CONFIG_PM up->capabilities |=UART_CAP_RPM ;#endif
Signature · 1 line
2.53.0