From: Jared Suttles Date: Fri, 7 Aug 2009 23:57:49 +0000 (-0500) Subject: USB: composite: Fix USB WHQL Certification Issues X-Git-Tag: firefly_0821_release~7613^2~833 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=258d10363551562f1f4677902c8b277abfc0ec68;p=firefly-linux-kernel-4.4.55.git USB: composite: Fix USB WHQL Certification Issues Submitted on behalf of RaviKumar Vembu Signed-off-by: Jared Suttles Signed-off-by: Mike Lockwood --- diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index a1a54b4050c8..07bb37ee07aa 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -894,11 +894,12 @@ 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