Commit 6f560125 authored by Sasha Levin's avatar Sasha Levin Committed by Greg Kroah-Hartman
Browse files

net, TTY: initialize tty->driver_data before usage



Commit 9c650ffc ("TTY: ircomm_tty, add tty install") split _open() to
_install() and _open(). It also moved the initialization of driver_data
out of open(), but never added it to install() - causing a NULL ptr
deref whenever the driver was used.

Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
Acked-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ecefbd94
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -421,6 +421,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
		hashbin_insert(ircomm_tty, (irda_queue_t *) self, line, NULL);
	}

	tty->driver_data = self;

	return tty_port_install(&self->port, driver, tty);
}