diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-01 23:49:12 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-01 23:49:12 +0200 |
commit | 6399232feb64816b28e2a01ee874ace1a6975c99 (patch) | |
tree | 2a46613c494e2a9b2908c993181122628a2e7458 /drivers/usb/gadget/composite.c | |
parent | Linux 4.7-rc1 (diff) | |
parent | usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command (diff) | |
download | linux-6399232feb64816b28e2a01ee874ace1a6975c99.tar.xz linux-6399232feb64816b28e2a01ee874ace1a6975c99.zip |
Merge tag 'fixes-for-v4.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
Felipe writes:
Here's the first set of fixes for v4.7-rc
cycle. Nothing extra fancy this time around.
Patches range from MS OS Descriptor usage fixes, to
Clear Stall EP command fix on dwc3, to some f_fs
fixes and out of bounds accesses on renesas driver.
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r-- | drivers/usb/gadget/composite.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index d67de0d22a2b..eb648485a58c 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1868,14 +1868,19 @@ unknown: } break; } - req->length = value; - req->context = cdev; - req->zero = value < w_length; - value = composite_ep0_queue(cdev, req, GFP_ATOMIC); - if (value < 0) { - DBG(cdev, "ep_queue --> %d\n", value); - req->status = 0; - composite_setup_complete(gadget->ep0, req); + + if (value >= 0) { + req->length = value; + req->context = cdev; + req->zero = value < w_length; + value = composite_ep0_queue(cdev, req, + GFP_ATOMIC); + if (value < 0) { + DBG(cdev, "ep_queue --> %d\n", value); + req->status = 0; + composite_setup_complete(gadget->ep0, + req); + } } return value; } |