USB: composite: Fix USB WHQL Certification Issues
authorJared Suttles <jared.suttles@motorola.com>
Fri, 7 Aug 2009 23:57:49 +0000 (18:57 -0500)
committerColin Cross <ccross@android.com>
Tue, 14 Jun 2011 16:08:53 +0000 (09:08 -0700)
Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com>
Signed-off-by: Jared Suttles <jared.suttles@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers/usb/gadget/composite.c

index a1a54b4050c8506d93ff7c306aef166aad4d4e8b..07bb37ee07aae08b313132a0d4f3bc9d8ca8335d 100644 (file)
@@ -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