Skip to content

Commit

Permalink
USB: gadget: fix req length in sourcesink_setup()
Browse files Browse the repository at this point in the history
The recent commit 2edb11c fixed req->length in the composite_setup()
function, but that will cause all g_zero tests to fail like:

root#> ./testusb -D /proc/bus/usb/002/021 -t14 -c 15000 -s 256 -v 1
unknown speed   /proc/bus/usb/002/021
/proc/bus/usb/002/021 test 14 --> 32 (Broken pipe)

We need to fix req->length in sourcesink_setup() as well to avoid this.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bob Liu authored and Greg Kroah-Hartman committed Jul 1, 2011
1 parent 6e7be1a commit 5030ec7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/gadget/f_sourcesink.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ static int sourcesink_setup(struct usb_configuration *c,
u16 w_value = le16_to_cpu(ctrl->wValue);
u16 w_length = le16_to_cpu(ctrl->wLength);

req->length = USB_BUFSIZ;

/* composite driver infrastructure handles everything except
* the two control test requests.
*/
Expand Down

0 comments on commit 5030ec7

Please sign in to comment.