]> Pileus Git - ~andy/linux/commitdiff
net, TTY: initialize tty->driver_data before usage
authorSasha Levin <sasha.levin@oracle.com>
Fri, 5 Oct 2012 00:01:21 +0000 (20:01 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Oct 2012 16:26:01 +0000 (09:26 -0700)
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: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/irda/ircomm/ircomm_tty.c

index 95a3a7a336ba86a0b8b3790a7ce8e722f17db1a2..496ce2cebcd7316f7a1eab1051758e2f90b22263 100644 (file)
@@ -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);
 }