summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-02-25 12:27:14 -0800
committerTony Lindgren <tony@atomide.com>2011-02-25 12:27:14 -0800
commit02fa9f0451ac639a687bfc145eefe58703ff220e (patch)
treefe984acc78f22f6eb8fb98efaba8b1ac2f3ad8d9 /drivers/usb/gadget/composite.c
parentcbc9438075ca9dee3f39a2e7310f81c304b40359 (diff)
parent51c404b2c514930e98e81e0b9294f19892a4f871 (diff)
Merge branch 'patches_for_2.6.38rc' of git://git.pwsan.com/linux-2.6 into devel-fixes
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index f6ff8456d52..1ba4befe336 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -928,8 +928,9 @@ unknown:
*/
switch (ctrl->bRequestType & USB_RECIP_MASK) {
case USB_RECIP_INTERFACE:
- if (cdev->config)
- f = cdev->config->interface[intf];
+ if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES)
+ break;
+ f = cdev->config->interface[intf];
break;
case USB_RECIP_ENDPOINT: