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

This commit is contained in:
qctecmdr 2021-08-26 07:37:15 -07:00 committed by Gerrit - the friendly Code Review server
commit 2e616bbbc3

View file

@ -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;
}