Skip to content

Commit e923822

Browse files
AlanSterngregkh
authored andcommitted
USB: dummy-hcd: accept mismatch between wLength and transfer length
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>
1 parent 527101c commit e923822

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

‎drivers/usb/gadget/dummy_hcd.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,11 +1306,6 @@ static void dummy_timer (unsigned long _dum)
13061306
setup = *(struct usb_ctrlrequest*) urb->setup_packet;
13071307
w_index = le16_to_cpu(setup.wIndex);
13081308
w_value = le16_to_cpu(setup.wValue);
1309-
if (le16_to_cpu(setup.wLength) !=
1310-
urb->transfer_buffer_length) {
1311-
status = -EOVERFLOW;
1312-
goto return_urb;
1313-
}
13141309

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

0 commit comments

Comments
 (0)