diff options
-rw-r--r-- | drivers/usb/gadget/composite.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 1ba4befe336b..bbbbfb707504 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c | |||
@@ -887,7 +887,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) | |||
887 | case USB_REQ_SET_INTERFACE: | 887 | case USB_REQ_SET_INTERFACE: |
888 | if (ctrl->bRequestType != USB_RECIP_INTERFACE) | 888 | if (ctrl->bRequestType != USB_RECIP_INTERFACE) |
889 | goto unknown; | 889 | goto unknown; |
890 | if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES) | 890 | if (!cdev->config || intf >= MAX_CONFIG_INTERFACES) |
891 | break; | 891 | break; |
892 | f = cdev->config->interface[intf]; | 892 | f = cdev->config->interface[intf]; |
893 | if (!f) | 893 | if (!f) |
@@ -899,7 +899,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) | |||
899 | case USB_REQ_GET_INTERFACE: | 899 | case USB_REQ_GET_INTERFACE: |
900 | if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE)) | 900 | if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE)) |
901 | goto unknown; | 901 | goto unknown; |
902 | if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES) | 902 | if (!cdev->config || intf >= MAX_CONFIG_INTERFACES) |
903 | break; | 903 | break; |
904 | f = cdev->config->interface[intf]; | 904 | f = cdev->config->interface[intf]; |
905 | if (!f) | 905 | if (!f) |
@@ -928,7 +928,7 @@ unknown: | |||
928 | */ | 928 | */ |
929 | switch (ctrl->bRequestType & USB_RECIP_MASK) { | 929 | switch (ctrl->bRequestType & USB_RECIP_MASK) { |
930 | case USB_RECIP_INTERFACE: | 930 | case USB_RECIP_INTERFACE: |
931 | if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES) | 931 | if (!cdev->config || intf >= MAX_CONFIG_INTERFACES) |
932 | break; | 932 | break; |
933 | f = cdev->config->interface[intf]; | 933 | f = cdev->config->interface[intf]; |
934 | break; | 934 | break; |