TTY: ttyprintk, initialize tty_port earlier
authorJiri Slaby <jslaby@suse.cz>
Tue, 7 Aug 2012 19:47:40 +0000 (21:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Aug 2012 20:29:57 +0000 (13:29 -0700)
commit536a3440a27f8687090bdf33468b003bc0f810cf
tree76f358685b2838f740df7e293101078177fa46e7
parentee8b593affdf893012e57f4c54a21984d1b0d92e
TTY: ttyprintk, initialize tty_port earlier

After tty_register_driver is called, it is too late to initialize a
guy with which we operate in open. When a process already called
open(2) on that node, the structures may be in use uninitialized.

Move the initialization prior to tty_register_driver.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Samo Pogacnik <samo_pogacnik@t-2.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ttyprintk.c