On Tuesday 26 April 2011 11:52:27 Bartosz Fabianowski wrote:
> 1. attach() is running and executes make_dev(). Before attach() has 
> finished, someone calls open() on the newly created device node and 
> tries to read from a device that is not fully instantiated.
> 
> 2. read() is running when the device is suddenly pulled (this is a USB 
> device) so that detach() gets run. Thus, detach() starts tearing down 
> data structures that read() may still be accessing.

Hi,

You need to handle all cases in your driver. Fortunately there exists a 
solution for this already, called USB cdev. See

serial/ulpt.c

for example.

--HPS
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to