Unverified Commit 3dba3120 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14882 usb: typec: fix potential array underflow in ucsi_ccg_sync_control()

parents e9dbd17a b129d636
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -585,6 +585,10 @@ static int ucsi_ccg_sync_write(struct ucsi *ucsi, unsigned int offset,
		    uc->has_multiple_dp) {
			con_index = (uc->last_cmd_sent >> 16) &
				    UCSI_CMD_CONNECTOR_MASK;
			if (con_index == 0) {
				ret = -EINVAL;
				goto err_clear_bit;
			}
			con = &uc->ucsi->connector[con_index - 1];
			ucsi_ccg_update_set_new_cam_cmd(uc, con, (u64 *)val);
		}