Exactly: it was linked, and that fact was advertised to the rest of the kernel. All parts of this story need to agree!
You're saying that this code at the end of hcd_submit_urb() is wrong:
status = hcd->driver->urb_enqueue (hcd, urb, mem_flags); done:
Yes -- right here should be something like
if (status == -ENOMSG) { /* unlink-during-submit */ giveback(urb); status = 0; } else
... or something very similar. Assuming all the HCDs return ENOMSG (or whatever never-given-to-drivers code is chosen) for this case.
if (status) { usb_put_urb (urb); urb_unlink (urb); } return status; }
Ignore for the moment code paths that reach the done: label via a jump.
I think there's just one, the root hub submit code. Which should behave exactly the same.
Regardless of the status returned by enqueue(), the URB has already been linked. So hcd_submit_urb() must return 0, not status. If enqueue() does return non-zero (any value, not just -ENOMSG) then the URB has to be sent to giveback; calling urb_unlink() is not enough.
Right. There's a call to urb_unlink() in giveback(), shortly before it actually gives back the urb.
- Dave
Alan Stern
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel