Am Montag, 23. Juni 2003 19:39 schrieb Tuukka Toivonen:
> Can usb_disconnect() and usb_probe() functions of a driver pre-empt the
> driver in other parts? I mean, that if user has just called my open()
> function in the driver, could usb_disconnect() happen before the system
> call returns?

Yes. Probe() and disconnect() will not preempt each other. Anything else
is possible.

> If usb_disconnect() can happen while already executing in open(), and if
> the former frees the data structures used by the driver, then the latter
> call might continue working with already freed memory region which could
> lead to catastrophe.
>
> So I guess it is not possible, but I'd like to have a confirmation. Also
> if somebody would care to explain a little why it isn't possible, would be
> nice.

It is possible. Appropriate locking in device drivers is a very good idea.

        HTH
                Oliver



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to