aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-20 09:58:10 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-20 09:58:10 +0100
commit236c9ad1f87088bb07ebdd136b8432f83dfd1e14 (patch)
treeae8713c9878593521f2cb517891f123f178fdd83 /drivers/usb/gadget/composite.c
parentusb: misc: ehset: Rework test mode entry (diff)
parentLinux 5.16-rc6 (diff)
downloadlinux-dev-236c9ad1f87088bb07ebdd136b8432f83dfd1e14.tar.xz
linux-dev-236c9ad1f87088bb07ebdd136b8432f83dfd1e14.zip
Merge 5.16-rc6 into usb-next
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 7dce462172cb..16f9e3423c9f 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1693,14 +1693,14 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
u8 endp;
if (w_length > USB_COMP_EP0_BUFSIZ) {
- if (ctrl->bRequestType == USB_DIR_OUT) {
- goto done;
- } else {
+ if (ctrl->bRequestType & USB_DIR_IN) {
/* Cast away the const, we are going to overwrite on purpose. */
__le16 *temp = (__le16 *)&ctrl->wLength;
*temp = cpu_to_le16(USB_COMP_EP0_BUFSIZ);
w_length = USB_COMP_EP0_BUFSIZ;
+ } else {
+ goto done;
}
}