Forráskód Böngészése

msm: camera: cci: Check if cci_info structure pointer is NULL

Though cci_ctrl is not NULL its content is handled by user,
who could set cci_info to NULL. A NULL pointer check is placed
before accessing it to avoid any null pointer derefernce.

CRs-Fixed: 3095084

Change-Id: I6f50d4ba38efd9b5c0eb0d14e3d958ff94c11554
Signed-off-by: Rajat Goel <[email protected]>
Signed-off-by: Shadul Shaikh <[email protected]>
(cherry picked from commit 81c7a070db15aea8a2d7835a68840ac31f4586fb)
Shadul Shaikh 3 éve
szülő
commit
9bd3915e24
1 módosított fájl, 3 hozzáadás és 2 törlés
  1. 3 2
      drivers/cam_sensor_module/cam_cci/cam_cci_core.c

+ 3 - 2
drivers/cam_sensor_module/cam_cci/cam_cci_core.c

@@ -1990,8 +1990,9 @@ int32_t cam_cci_core_cfg(struct v4l2_subdev *sd,
 		return -EINVAL;
 	}
 
-	if (!cci_ctrl) {
-		CAM_ERR(CAM_CCI, "CCI%d_I2C_M%d CCI_CTRL IS NULL", cci_dev->soc_info.index, master);
+	if (!cci_ctrl || !cci_ctrl->cci_info) {
+		CAM_ERR(CAM_CCI, "CCI%d_I2C_M%d CCI_CTRL OR CCI_INFO IS NULL",
+			cci_dev->soc_info.index, master);
 		return -EINVAL;
 	}