Skip to content

Commit ea0d762

Browse files
Thinh Nguyengregkh
authored andcommitted
usb: dwc3: gadget: Fix request complete check
We can only check for IN direction if the request had completed. For OUT direction, it's perfectly fine that the host can send less than the setup length. Let's return true fall all cases of OUT direction. Fixes: e0c42ce ("usb: dwc3: gadget: simplify IOC handling") Cc: [email protected] Signed-off-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/ac5a3593a94fdaa3d92e6352356b5f7a01ccdc7c.1576291140.git.thinhn@synopsys.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c80d0f4 commit ea0d762

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/usb/dwc3/gadget.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,6 +2467,13 @@ static int dwc3_gadget_ep_reclaim_trb_linear(struct dwc3_ep *dep,
24672467

24682468
static bool dwc3_gadget_ep_request_completed(struct dwc3_request *req)
24692469
{
2470+
/*
2471+
* For OUT direction, host may send less than the setup
2472+
* length. Return true for all OUT requests.
2473+
*/
2474+
if (!req->direction)
2475+
return true;
2476+
24702477
return req->request.actual == req->request.length;
24712478
}
24722479

0 commit comments

Comments
 (0)