If the request->length is zero, a ZLP should already be sent due to that
and another ZLP is not needed to terminate the transfer.
Fixes: 04c03d10e507 ("usb: dwc3: gadget: handle request->zero")
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit
d9261898a4b2c143c28568dc686a1becfc637a99)
Change-Id: Ib976552f93321f6ea52d3f0151c66fd6f2db8b17
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
* extra usb_request ourselves so that it gets handled the same way as
* any other request.
*/
- if (ret == 0 && request->zero && (request->length % ep->maxpacket == 0))
+ if (ret == 0 && request->zero && request->length &&
+ (request->length % ep->maxpacket == 0))
ret = __dwc3_gadget_ep_queue_zlp(dwc, dep);
spin_unlock_irqrestore(&dwc->lock, flags);