Commit 2dfc4234 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: set port->tty to NULL after we have closed the port

  
This lets any of the many checks for this contition actually have a
chance of working :)
parent 4340e885
......@@ -531,7 +531,7 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
dbg("%s - port %d", __FUNCTION__, port->number);
/* if disconnect beat us to the punch here, there's nothing to do */
if (tty->driver_data) {
if (tty && tty->driver_data) {
__serial_close(port, filp);
}
}
......@@ -830,6 +830,7 @@ static void destroy_serial (struct kobject *kobj)
while (port->open_count > 0) {
__serial_close(port, NULL);
}
port->tty = NULL;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment