Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
5d4121c0 63d48696

+4
+4
drivers/tty/tty_io.c
··· 1415 1415 if (!tty->port) 1416 1416 tty->port = driver->ports[idx]; 1417 1417 1418 + WARN_RATELIMIT(!tty->port, 1419 + "%s: %s driver does not set tty->port. This will crash the kernel later. Fix the driver!\n", 1420 + __func__, tty->driver->name); 1421 + 1418 1422 /* 1419 1423 * Structures all installed ... call the ldisc open routines. 1420 1424 * If we fail here just call release_tty to clean up. No need