On Thu, 20 Dec 2007, Oliver Neukum wrote:

> @@ -1080,20 +1081,22 @@ void usb_serial_disconnect(struct usb_in
>       usb_serial_console_disconnect(serial);
>       dbg ("%s", __FUNCTION__);
>  
> +     mutex_lock(&serial->disc_mutex);
>       usb_set_intfdata (interface, NULL);
> -     if (serial) {
> -             for (i = 0; i < serial->num_ports; ++i) {
> -                     port = serial->port[i];
> -                     if (port) {
> -                             if (port->tty)
> -                                     tty_hangup(port->tty);
> -                             kill_traffic(port);
> -                     }
> +     /* must use extra flag, as intfdata can be reset */
> +     serial->disconnected = 1;

This comment is misleading.  It implies there is a possibility you
actually could check for disconnects by looking at the value of
usb_get_intfdata(), but that's completely wrong.  There are about 13 
places in various serial drivers where this mistake is made; they all 
need to be fixed.

Don't you also have to check the disconnect flag in serial_close()  
before calling usb_autopm_put_interface()?

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to