summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2011-02-06 17:39:17 +0900
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 10:41:46 -0800
commitff085de758ebcb2309dd013fecb7cbb3cb6c7a43 (patch)
tree35803a695566a4f9daa921dcf87405ef679db885 /drivers/usb/gadget
parent66b0835e2bb3d345f060a47bb8c8f883bd25ec2b (diff)
downloadlinux-ff085de758ebcb2309dd013fecb7cbb3cb6c7a43.tar.bz2
USB: Gadget: Composite: Debug interface comparison
While checking valid interface number we should compare MAX_CONFIG_INTERFACES with the variable 'intf' (which holds the lower 8bits of w_index) rather than 'w_index' Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-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 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)
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;