aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2011-02-06 03:39:17 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 13:41:46 -0500
commitff085de758ebcb2309dd013fecb7cbb3cb6c7a43 (patch)
tree35803a695566a4f9daa921dcf87405ef679db885 /drivers/usb
parent66b0835e2bb3d345f060a47bb8c8f883bd25ec2b (diff)
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')
-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)
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;