Skip to content

Commit

Permalink
net, TTY: initialize tty->driver_data before usage
Browse files Browse the repository at this point in the history
Commit 9c650ff ("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>
  • Loading branch information
Sasha Levin authored and Greg Kroah-Hartman committed Oct 5, 2012
1 parent ecefbd9 commit 6f56012
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/irda/ircomm/ircomm_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 6f56012

Please sign in to comment.