summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2003-07-15 02:20:24 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2003-07-15 02:20:24 -0700
commit55ffe23325264ba4c1b115c28bad5dff5abf3a4e (patch)
tree464d3cadfd37359672aa3d975ca54100b314504e
parent9c9e072ed0331958b3d33bb5de8c22110a428f76 (diff)
[PATCH] USB: fix a nasty use-after-free bug in the usb-serial core.
-rw-r--r--drivers/usb/serial/usb-serial.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 8cc6f6fe7bb2..78b4337c86bd 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -530,7 +530,9 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
/* if disconnect beat us to the punch here, there's nothing to do */
if (tty && tty->driver_data) {
__serial_close(port, filp);
+ tty->driver_data = NULL;
}
+ port->tty = NULL;
}
static int serial_write (struct tty_struct * tty, int from_user, const unsigned char *buf, int count)