]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
tty: serial: fsl_lpuart: fix crash in lpuart_uport_is_active
authorSherry Sun <sherry.sun@nxp.com>
Thu, 23 Mar 2023 11:09:23 +0000 (19:09 +0800)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Wed, 17 May 2023 11:33:59 +0000 (13:33 +0200)
commitb4e07b42b466b494e90653067a730e9d1a24cf54
tree4e0edd1a6a5f22050e31e61a9920f2c2884f1f37
parent5c3c5b4f3f0c9e57eda073c023a453a5b2af77c1
tty: serial: fsl_lpuart: fix crash in lpuart_uport_is_active

BugLink: https://bugs.launchpad.net/bugs/2016879
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@kernel.org>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Link: https://lore.kernel.org/r/20230323110923.24581-1-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/tty/serial/fsl_lpuart.c