|
@@ -887,7 +887,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
|
|
case USB_REQ_SET_INTERFACE:
|
|
|
if (ctrl->bRequestType != USB_RECIP_INTERFACE)
|
|
|
goto unknown;
|
|
|
- if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES)
|
|
|
+ if (!cdev->config || intf >= MAX_CONFIG_INTERFACES)
|
|
|
break;
|
|
|
f = cdev->config->interface[intf];
|
|
|
if (!f)
|
|
@@ -899,7 +899,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
|
|
case USB_REQ_GET_INTERFACE:
|
|
|
if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE))
|
|
|
goto unknown;
|
|
|
- if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES)
|
|
|
+ if (!cdev->config || intf >= MAX_CONFIG_INTERFACES)
|
|
|
break;
|
|
|
f = cdev->config->interface[intf];
|
|
|
if (!f)
|
|
@@ -928,7 +928,7 @@ unknown:
|
|
|
*/
|
|
|
switch (ctrl->bRequestType & USB_RECIP_MASK) {
|
|
|
case USB_RECIP_INTERFACE:
|
|
|
- if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES)
|
|
|
+ if (!cdev->config || intf >= MAX_CONFIG_INTERFACES)
|
|
|
break;
|
|
|
f = cdev->config->interface[intf];
|
|
|
break;
|