USB: fix ohci_complete_add
Hello, Marcelo:
This is a fix for a ludicrously stupid bug in my code in usb-ohci, which only affects 2.4, fortunately. The problem should be obvious from the code:
when adding an element to the queue, an URB is lost if the queue contains two or more elements already. The fix is to implement the queue correctly:
add to the tail and do not corrupt the list.
Fortunately for us, this situation is rare and its impact is limited. More than two URBs have to complete in the same interrupt for this to happen, and this typically takes several devices operating simultaneously. When it happens, there is no memory leak and no oops, just a "lost callback" sort of situation. So, the priority of this is entirely at your discretion, but personally I'd like to see this in the next full release (2.4.28).
Yours,
-- Pete
drivers/usb/host/usb-ohci.c +1 -1
@@ -143,7 +143,7 @@ static void ohci_complete_add(struct ohc ohci->complete_head = urb; ohci->complete_tail = urb; }else { - ohci->complete_head->hcpriv = urb; + ohci->complete_tail->hcpriv = urb; ohci->complete_tail = urb; } }
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line
I've just release -rc4 which I plan to be the last -rc. :(
No problem, I'll resend and send Jes's fix too.
-- Pete