Skip to content

Commit 88e2582

Browse files
lynxeye-devgregkh
authored andcommitted
serial: core: fix crash in uart_suspend_port
With serdev we might end up with serial ports that have no cdev exported to userspace, as they are used as the bus interface to other devices. In that case serial_match_port() won't be able to find a matching tty_dev. Skip the irq wakeup enabling in that case, as serdev will make sure to keep the port active, as long as there are devices depending on it. Fixes: 8ee3fde (tty_port: register tty ports with serdev bus) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 925bb1c commit 88e2582

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/serial_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2083,7 +2083,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
20832083
mutex_lock(&port->mutex);
20842084

20852085
tty_dev = device_find_child(uport->dev, &match, serial_match_port);
2086-
if (device_may_wakeup(tty_dev)) {
2086+
if (tty_dev && device_may_wakeup(tty_dev)) {
20872087
if (!enable_irq_wake(uport->irq))
20882088
uport->irq_wake = 1;
20892089
put_device(tty_dev);

0 commit comments

Comments
 (0)