]> Pileus Git - ~andy/linux/commit
ttyprintk: Fix NULL pointer deref by setting tty_port ops after initializing port
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 10 May 2013 22:40:13 +0000 (15:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 May 2013 17:13:23 +0000 (10:13 -0700)
commitb5325a02aa84c794cf520d6d68cae4b150988a32
tree1f91407c6ac96bed7c0dea018ea0315648601954
parent89fb9e7c3423662f4969a1e8ef0f5d44835d2381
ttyprintk: Fix NULL pointer deref by setting tty_port ops after initializing port

tty_port_init() zeroes out the tty port, which means that we have to set the
ops pointer /after/, not before this call.  Otherwise, tty_port_open will crash
when it tries to deref ops, which is now a NULL pointer.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ttyprintk.c