1
0
Fork 0

MLK-23181-2 usb: cdns3: gadget: add one missing condition for cdns3_request_handled

If the dequeue pointer advances to the first trb, but the priv_req->end_trb
is the last trb, we consider the trb this dequeue pointer points doesn't
belong to this request.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Peter Chen 2020-01-07 12:15:01 +08:00
parent adb129da17
commit 3e7c6dff3e
No known key found for this signature in database
GPG Key ID: 4859298150D671BB
1 changed files with 7 additions and 3 deletions

View File

@ -840,9 +840,13 @@ static bool cdns3_request_handled(struct cdns3_endpoint *priv_ep,
priv_ep->trb_pool_dma) / TRB_SIZE;
/* current trb doesn't belong to this request */
if ((priv_req->start_trb < priv_req->end_trb) &&
(priv_ep->dequeue > priv_req->end_trb))
goto finish;
if (priv_req->start_trb < priv_req->end_trb) {
if (priv_ep->dequeue > priv_req->end_trb)
goto finish;
if (priv_ep->dequeue < priv_req->start_trb)
goto finish;
}
if ((priv_req->start_trb > priv_req->end_trb) &&
(priv_ep->dequeue > priv_req->end_trb) &&