summaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-08-17 14:27:52 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-17 15:39:06 +0200
commit5d4121c04b3577e37e389b3553d442f44bb346d7 (patch)
tree099321b0f69a095760379152248029db023d13e0 /drivers/tty/tty_io.c
parentfirmware: remove computone driver firmware and documentation (diff)
downloadlinux-5d4121c04b3577e37e389b3553d442f44bb346d7.tar.xz
linux-5d4121c04b3577e37e389b3553d442f44bb346d7.zip
TTY: check if tty->port is assigned
And if not, complain loudly. None in-kernel module should trigger that, but let us find out for sure. On the other hand, all the out-of-tree modules will hit that. Give them some time (maybe one release) to catch up. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 28c3e869ebba..41e42f13a214 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1415,6 +1415,10 @@ struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx)
if (!tty->port)
tty->port = driver->ports[idx];
+ WARN_RATELIMIT(!tty->port,
+ "%s: %s driver does not set tty->port. This will crash the kernel later. Fix the driver!\n",
+ __func__, tty->driver->name);
+
/*
* Structures all installed ... call the ldisc open routines.
* If we fail here just call release_tty to clean up. No need