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

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

Merge "usb: pd: Clear vdm_tx if SVDM message is sent on SOP'"

parents d8ffa18e 742d9706
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1721,8 +1721,12 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type)

		mutex_unlock(&pd->svid_handler_lock);
		/* retry when hitting PE_SRC/SNK_Ready again */
		if (ret != -EBUSY && sop_type == SOP_MSG)
		if (ret != -EBUSY && sop_type == SOP_MSG) {
			usbpd_set_state(pd, PE_SEND_SOFT_RESET);
		} else if (sop_type != SOP_MSG) {
			kfree(pd->vdm_tx);
			pd->vdm_tx = NULL;
		}

		return;
	}