Skip to content

Commit

Permalink
USB: dummy-hcd: accept mismatch between wLength and transfer length
Browse files Browse the repository at this point in the history
This patch (as1269) fixes a bug in the way dummy_hcd handles control
URBs.  Currently it returns a -EOVERFLOW error if the wLength value in
the setup packet is different from the URB's transfer_buffer_length.

Other host controller drivers don't do this.  There's no reason the
two length values have to be equal, and in fact they sometimes aren't
-- a driver might set the transfer length to the maxpacket value in
order to handle buggy devices that don't respect wLength.

This patch simply removes the unnecessary check and error return.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Sep 23, 2009
1 parent 527101c commit e923822
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1306,11 +1306,6 @@ static void dummy_timer (unsigned long _dum)
setup = *(struct usb_ctrlrequest*) urb->setup_packet;
w_index = le16_to_cpu(setup.wIndex);
w_value = le16_to_cpu(setup.wValue);
if (le16_to_cpu(setup.wLength) !=
urb->transfer_buffer_length) {
status = -EOVERFLOW;
goto return_urb;
}

/* paranoia, in case of stale queued data */
list_for_each_entry (req, &ep->queue, queue) {
Expand Down

0 comments on commit e923822

Please sign in to comment.