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

Commit 89bc856e authored by John Youn's avatar John Youn Committed by Felipe Balbi
Browse files

usb: dwc3: gadget: Don't prepare TRBs if no space



If trbs_left == 0, we don't have any space left in the TRB ring so don't
prepare anything.

Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 0d25744a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -942,6 +942,8 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep)
	BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM);

	trbs_left = dwc3_calc_trbs_left(dep);
	if (!trbs_left)
		return;

	list_for_each_entry_safe(req, n, &dep->pending_list, list) {
		if (req->request.num_mapped_sgs > 0)