On Tue, 1 Jun 2004, Luca Risolia wrote:

> It seems usb_unlink_urb(submitted_urb) causes a kernel
> oops if called after the usbcore completes usb_disconnect(),
> during fileop->close(), when the device is hardware-disconnected
> while streaming.
>                                                                           
> Below is the oops from the kernel and (part of) the code calling
> usb_unlink_urb(). The same code used to work on previous versions of the kernel.

I'm not sure what happened with earlier versions of the kernel, but here
it looks like you are calling usb_unlink_urb() after your disconnect()
routine has returned.  By that time the struct usb_device has already been
deallocated, so it's too late.  You must not unlink the urb during close()  
if the device has been disconnected; you must unlink it during
disconnect() instead.

Actually, when the device is unplugged usbcore will unlink all its URBs 
automatically.  However it is possible that your disconnect() was called 
because the driver module is being unloaded while the device remains 
plugged in; in that case the URBs won't be unlinked automatically and you 
_must_ unlink them in disconnect().

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to