From 047806b490c055685606579602ddad2b0a8a51da Mon Sep 17 00:00:00 2001 From: Jared Suttles Date: Fri, 7 Aug 2009 18:57:49 -0500 Subject: [PATCH] USB: composite: Fix USB WHQL Certification Issues Submitted on behalf of RaviKumar Vembu Signed-off-by: Jared Suttles Signed-off-by: Mike Lockwood --- drivers/usb/gadget/composite.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 65012ff1c2ed..6fd9f08d9010 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -856,11 +856,11 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) case USB_REQ_GET_CONFIGURATION: if (ctrl->bRequestType != USB_DIR_IN) goto unknown; - if (cdev->config) + if (cdev->config) { *(u8 *)req->buf = cdev->config->bConfigurationValue; - else + value = min(w_length, (u16) 1); + } else *(u8 *)req->buf = 0; - value = min(w_length, (u16) 1); break; /* function drivers must handle get/set altsetting; if there's @@ -910,6 +910,9 @@ unknown: */ switch (ctrl->bRequestType & USB_RECIP_MASK) { case USB_RECIP_INTERFACE: + if (cdev->config == NULL) + return value; + f = cdev->config->interface[intf]; break; -- 2.34.1