瀏覽代碼

Merge "msm: camera: isp: Check for NULL ptr" into camera-kernel.lnx.5.0

Haritha Chintalapati 3 年之前
父節點
當前提交
8eff7648b4
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      drivers/cam_isp/cam_isp_context.c

+ 5 - 0
drivers/cam_isp/cam_isp_context.c

@@ -5794,6 +5794,11 @@ static int __cam_isp_ctx_get_isp_info(int32_t dev_hdl, void *data)
 
 	ctx = (struct cam_context *)cam_get_device_priv(dev_hdl);
 
+	if (!ctx) {
+		CAM_ERR(CAM_ISP, "Cannot get context for handle %d", dev_hdl);
+		return -EINVAL;
+	}
+
 	isp_ctx = (struct cam_isp_context *)ctx->ctx_priv;
 
 	isp_dev->state = isp_ctx->substate_activated;