Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1664102 > unrolled thread

[PATCH 4.11 034/150] serial: core: fix crash in uart_suspend_port

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-06-12 19:30 +0200
Last post2017-06-12 19:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.11 034/150] serial: core: fix crash in uart_suspend_port Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-12 19:30 +0200

#1664102 — [PATCH 4.11 034/150] serial: core: fix crash in uart_suspend_port

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-06-12 19:30 +0200
Subject[PATCH 4.11 034/150] serial: core: fix crash in uart_suspend_port
Message-ID<tRBk8-52r-65@gated-at.bofh.it>
4.11-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lucas Stach <l.stach@pengutronix.de>

commit 88e2582e90bb89fe895ff0dceeb5d5ab65d07997 upstream.

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: 8ee3fde04758 (tty_port: register tty ports with serdev bus)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/tty/serial/serial_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2083,7 +2083,7 @@ int uart_suspend_port(struct uart_driver
 	mutex_lock(&port->mutex);
 
 	tty_dev = device_find_child(uport->dev, &match, serial_match_port);
-	if (device_may_wakeup(tty_dev)) {
+	if (tty_dev && device_may_wakeup(tty_dev)) {
 		if (!enable_irq_wake(uport->irq))
 			uport->irq_wake = 1;
 		put_device(tty_dev);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web