>>From eeffa986dfd4ffcca1ed3332ffd3ff4645a4cf1d Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Sat, 3 Nov 2012 16:49:29 +0100 Subject: [PATCH] tty debug part 2 Signed-off-by: Jiri Slaby --- drivers/tty/pty.c | 2 +- drivers/tty/tty_buffer.c | 2 +- drivers/tty/tty_io.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 4219f04..7438589 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -372,7 +372,7 @@ static void pty_unix98_shutdown(struct tty_struct *tty) static void pty_cleanup(struct tty_struct *tty) { - tty->port->itty = NULL; + tty->port->itty = ERR_PTR(-2); kfree(tty->port); } diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index ef020e2..a672f67 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -471,7 +471,7 @@ static void flush_to_ldisc(struct work_struct *work) struct tty_ldisc *disc; tty = port->itty; - if (WARN_RATELIMIT(tty == NULL, "tty is NULL")) + if (WARN_RATELIMIT(IS_ERR_OR_NULL(tty), "tty is bad=%ld ops=%ps", PTR_ERR(tty), port->ops)) return; disc = tty_ldisc_ref(tty); diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index a3eba7f..d06b978 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1553,7 +1553,7 @@ static void release_tty(struct tty_struct *tty, int idx) tty->ops->shutdown(tty); tty_free_termios(tty); tty_driver_remove_tty(tty->driver, tty); - tty->port->itty = NULL; + tty->port->itty = ERR_PTR(-1); if (tty->link) tty_kref_put(tty->link); -- 1.8.0