Alan Stern wrote: >Look at usb-skeleton.c. Exactly this problem was corrected there by >adding a static lock a couple of months ago.
Thanks for the tip. Although my intention was not to ask how to fix the bug, but point out that ov511.c appears to be buggy. If people agree, I can try fixing it. A simple question about usb-skeleton.c (kernel 2.4.21): - Is there a particular reason that the mutex at skel_disconnect:645 is unlocked before freeing the memory: if (!dev->open_count) { up (&dev->sem); <- 645 skel_delete (dev); } else { I don't see any reason, the mutex is being destroyed anyway. It would be safer to not unlock the mutex, if there is somebody waiting for it, it is a bug, but it would hang indefinitely instead of corrupting random memory if the mutex were not unlocked. Oliver wrote: >Somebody has broken the USB v4l drivers in the disconnect path >by changing drivers/media/video/videodev.c >In earlier times deregistering a v4l ensured that the driver would not >be called into after the call returned. Yes, but I don't see how that's related to this thread. The point was that open() syscall might be already called, but before the first line of the corresponding function was executed, usb_disconnect() happens. It doesn't matter whether usb_disconnect() unregisters the v4l device or not; open() call will be executed anyway. Or are you implying that video_unregister_device() should sleep until the open() call has finished? If video_unregister_device() is called while the device is open, the corresponding close() call would be then never made (not a problem, I imagine). ------------------------------------------------------- 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