On Wed, 1 Jun 2005, Dmitry Torokhov wrote:

> On 6/1/05, Alan Stern <[EMAIL PROTECTED]> wrote:
> > Using a private semaphore for synchronization,
> > you can guarantee that dev.driver_data is NULL whenever your driver is
> > bound to the interface and the private data doesn't exist.
> 
> BTW, you can't use private semaphore... Well, you can as long as it is
> driver-wide semaphore, i.e. statically allocated one. Otherwise you
> will free the semaphore together with acecad structure it is embedded
> into in disconnect method.

Yes, that's what I meant.  Since attributes acquire a reference to the
driver's module while they are open, there's no danger of userspace
accessing a stale attribute or trying to refer to the static semaphore
after the driver has been unloaded.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to