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

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
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment