This is a note to let you know that I've just added the patch titled tty: serial: fsl_lpuart: fix crash in lpuart_uport_is_active to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: tty-serial-fsl_lpuart-fix-crash-in-lpuart_uport_is_active.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 178e00f36f934a88682d96aa046c1f90cb6f83a7 Mon Sep 17 00:00:00 2001 From: Sherry Sun <sherry.sun@xxxxxxx> Date: Thu, 23 Mar 2023 19:09:23 +0800 Subject: tty: serial: fsl_lpuart: fix crash in lpuart_uport_is_active From: Sherry Sun <sherry.sun@xxxxxxx> commit 178e00f36f934a88682d96aa046c1f90cb6f83a7 upstream. For serdev framework, tty->dev is a NULL pointer, lpuart_uport_is_active calling device_may_wakeup() may cause kernel NULL pointer crash, so here add the NULL pointer check before using it. Fixes: 4f5cb8c5e915 ("tty: serial: fsl_lpuart: enable wakeup source for lpuart") Cc: stable <stable@xxxxxxxxxx> Signed-off-by: Sherry Sun <sherry.sun@xxxxxxx> Link: https://lore.kernel.org/r/20230323110923.24581-1-sherry.sun@xxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/tty/serial/fsl_lpuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -2896,7 +2896,7 @@ static bool lpuart_uport_is_active(struc tty = tty_port_tty_get(port); if (tty) { tty_dev = tty->dev; - may_wake = device_may_wakeup(tty_dev); + may_wake = tty_dev && device_may_wakeup(tty_dev); tty_kref_put(tty); } Patches currently in stable-queue which might be from sherry.sun@xxxxxxx are queue-6.2/tty-serial-fsl_lpuart-fix-crash-in-lpuart_uport_is_active.patch queue-6.2/tty-serial-fsl_lpuart-avoid-checking-for-transfer-complete-when-uartctrl_sbk-is-asserted-in-lpuart32_tx_empty.patch