Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e7cf0b1 authored by John Youn's avatar John Youn Committed by Dmitry Shmidt
Browse files

UPSTREAM: usb: dwc3: gadget: don't send extra ZLP



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.

(cherry-picked from commit
d9261898a4b2c143c28568dc686a1becfc637a99)

Fixes: 04c03d10e507 ("usb: dwc3: gadget: handle request->zero")
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarBadhri Jagan Sridharan <Badhri@google.com>
Bug: 63867169
Change-Id: I97a1801c57dc169b6e9371d5aec599a14f316aff
parent 9e6afd4e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1259,7 +1259,8 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
	 * 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);

out: