From: Bob Liu Date: Thu, 23 Jun 2011 21:09:49 +0000 (-0400) Subject: USB: gadget: fix req length in sourcesink_setup() X-Git-Tag: firefly_0821_release~3680^2~4926^2~30 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5030ec730279eabafccf862f3c8393af90c258a5;p=firefly-linux-kernel-4.4.55.git USB: gadget: fix req length in sourcesink_setup() The recent commit 2edb11cbac 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 Signed-off-by: Mike Frysinger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c index caf2f95e0346..5a92883f4c8c 100644 --- a/drivers/usb/gadget/f_sourcesink.c +++ b/drivers/usb/gadget/f_sourcesink.c @@ -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. */