Ping ... On Sun, Feb 6, 2011 at 5:39 PM, Jassi Brar <jassisinghbrar@xxxxxxxxx> wrote: > From: Jassi Brar <jassi.brar@xxxxxxxxxxx> > > 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@xxxxxxxxxxx> > --- > Â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 92bb61a..53e0496 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; > -- > 1.7.0.1 > > ÿô.nÇ·®+%˱é¥wÿº{.nÇ·¥{±þë)íèjg¬±¨¶Ýjÿ¾«þG«é¸¢·¦j:+v¨wèm¶ÿþø®w¥þ࣢·hâÿÙ