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

Commit 00474817 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: Avoid NULL pointer access"

parents 8e6cd729 d048da8b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1029,6 +1029,9 @@ static struct dwc3_trb *dwc3_ep_prev_trb(struct dwc3_ep *dep, u8 index)
{
	u8 tmp = index;

	if (!dep->trb_pool)
		return NULL;

	if (!tmp)
		tmp = DWC3_TRB_NUM - 1;

@@ -1696,7 +1699,11 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol)
		else
			trb = &dwc->ep0_trb[dep->trb_enqueue];

		if (trb)
			transfer_in_flight = trb->ctrl & DWC3_TRB_CTRL_HWO;
		else
			transfer_in_flight = false;

		started = !list_empty(&dep->started_list);

		if (!protocol && ((dep->direction && transfer_in_flight) ||