Browse Source

msm: camera: isp: Check ife out res validity

This change adds validity check for ife out res. If ife out res is
NULL we can run into crash/issues.

CRs-Fixed: 2915741
Change-Id: I8722b2a4e2634bda42f0080e00bf09050bbd6b91
Signed-off-by: Vikram Sharma <[email protected]>
Vikram Sharma 4 năm trước cách đây
mục cha
commit
c8d5a2827f

+ 8 - 0
drivers/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c

@@ -142,6 +142,14 @@ static int cam_isp_update_dual_config(
 		}
 
 		hw_mgr_res = &res_list_isp_out[i];
+		if (!hw_mgr_res) {
+			CAM_ERR(CAM_ISP,
+				"Invalid isp out resource i %d num_out_res %d",
+				i, dual_config->num_ports);
+			rc = -EINVAL;
+			goto end;
+		}
+
 		for (j = 0; j < CAM_ISP_HW_SPLIT_MAX; j++) {
 			if (!hw_mgr_res->hw_res[j])
 				continue;