On Fri, 16 Mar 2012, Johan Hovold wrote:

> Fix race between probe and open by making sure that the disconnected
> flag is not cleared until all ports have been registered and the serial
> struct is fully initialised.
> 
> A call to tty_open while probe is running may get a reference to the
> serial structure in serial_install before its ports have been
> registered. This may lead to usb_serial_core calling driver open before
> port is fully initialised.

Are you sure that is really the problem?  It doesn't seem to make sense
-- before a port has been registered there should be no device file to
open.

> @@ -1088,6 +1094,7 @@ int usb_serial_probe(struct usb_interface *interface,
>  exit:
>       /* success */
>       usb_set_intfdata(interface, serial);
> +     serial->disconnected = 0;
>       module_put(type->driver.owner);
>       return 0;

On the other hand, it certainly seems like a good idea to move this
usb_set_intfdata() call above the loop where the ports are registered.

Alan Stern


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

Reply via email to