Merge "msm: camera: isp: Add checks to ensure valid out resource info in dump" into camera-kernel.lnx.4.0

这个提交包含在:
Haritha Chintalapati
2020-11-11 13:58:21 -08:00
提交者 Gerrit - the friendly Code Review server
当前提交 31615a50c2
修改 2 个文件,包含 35 行新增13 行删除

查看文件

@@ -7599,19 +7599,21 @@ static int cam_ife_hw_mgr_handle_hw_dump_info(
}
}
out_port_id = event_info->res_id & 0xFF;
hw_mgr_res =
&ife_hw_mgr_ctx->res_list_ife_out[out_port_id];
for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
if (!hw_mgr_res->hw_res[i])
continue;
hw_intf = hw_mgr_res->hw_res[i]->hw_intf;
if (hw_intf->hw_ops.process_cmd) {
rc = hw_intf->hw_ops.process_cmd(
hw_intf->hw_priv,
CAM_ISP_HW_CMD_DUMP_BUS_INFO,
(void *)event_info,
sizeof(struct cam_isp_hw_event_info));
if (event_info->res_type == CAM_ISP_RESOURCE_VFE_OUT) {
out_port_id = event_info->res_id & 0xFF;
hw_mgr_res =
&ife_hw_mgr_ctx->res_list_ife_out[out_port_id];
for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
if (!hw_mgr_res->hw_res[i])
continue;
hw_intf = hw_mgr_res->hw_res[i]->hw_intf;
if (hw_intf->hw_ops.process_cmd) {
rc = hw_intf->hw_ops.process_cmd(
hw_intf->hw_priv,
CAM_ISP_HW_CMD_DUMP_BUS_INFO,
(void *)event_info,
sizeof(struct cam_isp_hw_event_info));
}
}
}

查看文件

@@ -630,6 +630,8 @@ static enum cam_vfe_bus_ver3_vfe_out_type
case CAM_ISP_IFE_LITE_OUT_RES_GAMMA:
return CAM_VFE_BUS_VER3_VFE_OUT_GAMMA;
default:
CAM_WARN(CAM_ISP, "Invalid isp res id: %d , assigning max",
res_type);
return CAM_VFE_BUS_VER3_VFE_OUT_MAX;
}
}
@@ -2508,8 +2510,26 @@ static int cam_vfe_bus_ver3_print_dimensions(
int i;
uint32_t addr_status0, addr_status1, addr_status2, addr_status3;
if (!bus_priv) {
CAM_ERR(CAM_ISP, "Invalid bus private data, res_id: %d",
vfe_out_res_id);
return -EINVAL;
}
if (vfe_out_res_id >= CAM_VFE_BUS_VER3_VFE_OUT_MAX) {
CAM_ERR(CAM_ISP, "Invalid out resource for dump: %d",
vfe_out_res_id);
return -EINVAL;
}
rsrc_node = &bus_priv->vfe_out[vfe_out_res_id];
rsrc_data = rsrc_node->res_priv;
if (!rsrc_data) {
CAM_ERR(CAM_ISP, "VFE out data is null, res_id: %d",
vfe_out_res_id);
return -EINVAL;
}
for (i = 0; i < rsrc_data->num_wm; i++) {
wm_data = rsrc_data->wm_res[i].res_priv;
common_data = rsrc_data->common_data;