summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2020-03-20 08:34:53 +0800
committerPeter Chen <peter.chen@nxp.com>2020-03-27 11:21:59 +0800
commit64c25ec54b0bd8ef5a8b8ac6b6f2c28238ca257d (patch)
tree52c65f698765ea66f9ab88d1192aa3174b6dda14 /drivers/usb/cdns3
parent89a49f36e0fba41f302c4d102f75bf9ae634a2ad (diff)
MLK-23677-1 usb: cdns3: gadget: the initialize value for trb->length should be zero
With commit d2e892c29de0 ("MLK-23595-1 usb: cdns3: gadget: calculate TDL per TD"), the first trb->length assignment is moved before the do-while loop, but only considering DEV_VER_V2 situation, in fact, we need to initialize trb->length for all situations. Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r--drivers/usb/cdns3/gadget.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 82464bf93974..9932c1287bf9 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -668,6 +668,7 @@ int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
/* set incorrect Cycle Bit for first trb*/
control = priv_ep->pcs ? 0 : TRB_CYCLE;
+ trb->length = 0;
if (request->num_mapped_sgs)
s = request->sg;