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

!15081 usb: typec: fix potential out of bounds in ucsi_ccg_update_set_new_cam_cmd()

parents 477dce52 7c113a98
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -436,6 +436,8 @@ static void ucsi_ccg_update_set_new_cam_cmd(struct ucsi_ccg *uc,

	port = uc->orig;
	new_cam = UCSI_SET_NEW_CAM_GET_AM(*cmd);
	if (new_cam >= ARRAY_SIZE(uc->updated))
		return;
	new_port = &uc->updated[new_cam];
	cam = new_port->linked_idx;
	enter_new_mode = UCSI_SET_NEW_CAM_ENTER(*cmd);