diff options
author | Samuel Iglesias Gonsálvez <siglesias@igalia.com> | 2012-07-13 13:33:13 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-17 04:11:37 +0200 |
commit | 1337b07e664c5a40ae0c5cbc13f5da4cf37c870c (patch) | |
tree | d3d1c94a61883b020efbc0bbe8d3424c336d9e3e /drivers | |
parent | staging: comedi: dt282x: remove the outw wrapper macros (diff) | |
download | linux-1337b07e664c5a40ae0c5cbc13f5da4cf37c870c.tar.xz linux-1337b07e664c5a40ae0c5cbc13f5da4cf37c870c.zip |
Staging: ipack/devices/ipoctal: fix dereference NULL pointer
After opening and closing the file /dev/ipoctal.X.Y.Z for the second time, it
gives a kernel oops due to a dereference of a NULL pointer.
The problem was that tty->driver_data was not properly initialized when
accessing the file for the second time.
Reported-by: Alberto Garcia Gonzalez <agarcia@igalia.com>
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/ipack/devices/ipoctal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/ipack/devices/ipoctal.c b/drivers/staging/ipack/devices/ipoctal.c index a5af423a4e7c..a1aae40ce68d 100644 --- a/drivers/staging/ipack/devices/ipoctal.c +++ b/drivers/staging/ipack/devices/ipoctal.c @@ -114,8 +114,6 @@ static int ipoctal_port_activate(struct tty_port *port, struct tty_struct *tty) ipoctal_write_io_reg(ipoctal, &ipoctal->chan_regs[channel].u.w.cr, CR_ENABLE_RX); - tty->driver_data = ipoctal; - return 0; } @@ -136,6 +134,8 @@ static int ipoctal_open(struct tty_struct *tty, struct file *file) if (atomic_read(&ipoctal->open[channel])) return -EBUSY; + tty->driver_data = ipoctal; + res = tty_port_open(&ipoctal->tty_port[channel], tty, file); if (res) return res; |