usb: dwc3: ep0: Fix endianness of wIndex passed to dwc3_wIndex_to_dep
authorJohn Youn <johnyoun@synopsys.com>
Mon, 23 May 2016 18:32:38 +0000 (11:32 -0700)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 20 Jun 2016 09:32:42 +0000 (12:32 +0300)
The wIndex passed in here is CPU endianness, but the function expects
little endian.

Found with sparse.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/ep0.c

index 54628c37b21f3c79a2fa81f55f1163b2ea8a0311..c814dde27138ec72424a9b3b9d7b7a74984288b8 100644 (file)
@@ -496,7 +496,7 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
        case USB_RECIP_ENDPOINT:
                switch (wValue) {
                case USB_ENDPOINT_HALT:
-                       dep = dwc3_wIndex_to_dep(dwc, wIndex);
+                       dep = dwc3_wIndex_to_dep(dwc, ctrl->wIndex);
                        if (!dep)
                                return -EINVAL;
                        if (set == 0 && (dep->flags & DWC3_EP_WEDGE))
This page took 0.029124 seconds and 5 git commands to generate.