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

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

Merge "usb: dwc3: gadget: Prevent double free scenario for cancelled_list"

parents 6a0c16b5 ef72d443
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3427,10 +3427,13 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
		dep->dbg_ep_events.epcmdcomplete++;
		cmd = DEPEVT_PARAMETER_CMD(event->parameters);

		if (cmd == DWC3_DEPCMD_ENDTRANSFER) {
		if (cmd == DWC3_DEPCMD_ENDTRANSFER &&
			(dep->flags & DWC3_EP_END_TRANSFER_PENDING)) {
			dep->flags &= ~DWC3_EP_END_TRANSFER_PENDING;
			dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
			dwc3_gadget_ep_cleanup_cancelled_requests(dep);
			dbg_log_string("DWC3_DEPEVT_EPCMDCMPLT (%d)",
							dep->number);

			if (dep->flags & DWC3_EP_PENDING_CLEAR_STALL) {
				struct dwc3 *dwc = dep->dwc;