On Wednesday 11 April 2001 23:10, you wrote:
> We use reference counting for most of the structures we use. The ioctl
> (or usbdevfs) should increment the reference count on the device when
> the application open's the device.
> When usb_disconnect gets called, it'll decrement the reference count and
> won't free the memory for the structure.

In the standard kernel only three drivers use the reference counts, according 
to a grep usb_inc_dev_use, and they increase the refcount in probe() and 
decrement it in disconnect(). Is there any guarantee that there are no 
running file_operations during disconnect()? Otherwise the refcount doesnt 
help. Incrementing the refcount in the ioctl handler isn't much better, the 
usb_device struct could have been freed in the time between the ioctl start 
and the refcount incrementation. Using refcounts only lowers the probability 
of a failure.

bye...


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to