On Wed, 25 Jun 2003, Tuukka Toivonen wrote: > On Mon, 23 Jun 2003, Oliver Neukum wrote: > > >> >> 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. > > >Exactly. Very good. Therefore you must never free [in usb_disconnect() -tt] > >the lock and that piece of data (usually a pointer to a device descriptor) > > Thank you very much. These were the magic words I wanted to hear. So the > solution is to use _static_ lock. > > >Many examples can be found in the kernel sources. > > Right. So let's look at drivers/usb/ov511.c (2.4.21).
Look at usb-skeleton.c. Exactly this problem was corrected there by adding a static lock a couple of months ago. Alan Stern ------------------------------------------------------- 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