FS#8683 - usb_core.c possible bug

Attached to Project: Rockbox
Opened by Joshua Simmons (mud) - Wednesday, 05 March 2008, 00:15 GMT
Last edited by Barry Wardell (barrywardell) - Wednesday, 12 March 2008, 20:18 GMT
Task Type Bugs
Category Drivers
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


In lines 477-481 of firmware/usbstack/usb_core.c (noticed in r16521) there is a possible bug. I'd make a patch but I don't know the correct fix.

The relevant text is:
if (req->wValue)
usb_drv_stall(req->wIndex & 0xf, false,(req->wIndex & 0x80) !=0);
usb_drv_stall(req->wIndex & 0xf, false,(req->wIndex & 0x80) !=0);

This is basically if(something) do_x(); else do_x(); do_y();
Very confusing at best.

I mentioned this in irc, but nobody seemed to notice. Sorry if someone is already looking into it.
This task depends upon

Closed by  Barry Wardell (barrywardell)
Wednesday, 12 March 2008, 20:18 GMT
Reason for closing:  Fixed
Comment by Frank Gevaerts (fg) - Wednesday, 12 March 2008, 16:41 GMT
Fixed. I saw it in the irc logs.