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


Groups > linux.kernel > #1290508

[PATCH 3/8] serial: core: Use tty->index for port # in debug messages

From Peter Hurley <peter@hurleysoftware.com>
Newsgroups linux.kernel
Subject [PATCH 3/8] serial: core: Use tty->index for port # in debug messages
Date 2015-12-13 01:40 +0100
Message-ID <qF2RI-14v-17@gated-at.bofh.it> (permalink)
References <qF2RH-14v-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The uart port may have already been removed by uart_remove_one_port();
use equivalent tty->index (which is always valid in these contexts)
instead.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/serial/serial_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 89b5ddd..4430518 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1383,8 +1383,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
 
 	uport = state->uart_port;
 	port = &state->port;
-
-	pr_debug("uart_close(%d) called\n", uport ? uport->line : -1);
+	pr_debug("uart_close(%d) called\n", tty->index);
 
 	if (!port->count || tty_port_close_start(port, tty, filp) == 0)
 		return;
@@ -1498,7 +1497,7 @@ static void uart_hangup(struct tty_struct *tty)
 	struct tty_port *port = &state->port;
 	unsigned long flags;
 
-	pr_debug("uart_hangup(%d)\n", state->uart_port->line);
+	pr_debug("uart_hangup(%d)\n", tty->index);
 
 	mutex_lock(&port->mutex);
 	if (port->flags & ASYNC_NORMAL_ACTIVE) {
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] Fix unsafe uart port access Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 01:40 +0100
  [PATCH 4/8] serial: core: Take port mutex for send_xchar() tty method Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 01:40 +0100
  [PATCH 3/8] serial: core: Use tty->index for port # in debug messages Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 01:40 +0100
  [PATCH 1/8] serial: core: Fold __uart_put_char() into caller Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 01:40 +0100
  [PATCH 5/8] serial: core: Expand port mutex section in uart_poll_init() Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 01:40 +0100
  [PATCH 6/8] serial: core: Prevent unsafe uart port access, part 1 Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 01:40 +0100
  [PATCH 2/8] serial: core: Fold do_uart_get_info() into caller Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 01:40 +0100
  [PATCH 7/8] serial: core: Prevent unsafe uart port access, part 2 Peter Hurley <peter@hurleysoftware.com> - 2015-12-13 01:40 +0100

csiph-web