瀏覽代碼

msm: camera: isp: Number of valid vc dt check

Added num_valid_vc_dt check before first cid get call.

CRs-Fixed: 3248380
Change-Id: I02605adead5e2fd98db952e7c41ea2d56af38591
Signed-off-by: Yash Upadhyay <[email protected]>
Yash Upadhyay 1 年之前
父節點
當前提交
42466f8068
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_core.c

+ 7 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_core.c

@@ -379,6 +379,13 @@ static int cam_tfe_csid_cid_get(struct cam_tfe_csid_hw *csid_hw,
 {
 	uint32_t  i = 0, j = 0;
 
+	if (num_valid_vc_dt == 0 || num_valid_vc_dt > CAM_ISP_TFE_VC_DT_CFG) {
+		CAM_ERR(CAM_ISP, "CSID:%d invalid num_valid_vc_dt: %d",
+			csid_hw->hw_intf->hw_idx, num_valid_vc_dt);
+		return -EINVAL;
+	}
+
+
 	/* Return already reserved CID if the VC/DT matches */
 	for (i = 0; i < CAM_TFE_CSID_CID_MAX; i++) {
 		if (csid_hw->cid_res[i].cnt >= 1) {