Merge "mm-camera2:isp2: Add NULL check for stream_info pointer"
This commit is contained in:
commit
6eefc68d77
2 changed files with 56 additions and 1 deletions
|
@ -1907,6 +1907,10 @@ void msm_vfe47_cfg_axi_ub_equal_default(
|
||||||
|
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(axi_data->free_wm[i]));
|
HANDLE_TO_IDX(axi_data->free_wm[i]));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s: stream_info is NULL!", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
vfe_idx = msm_isp_get_vfe_idx_for_stream(vfe_dev,
|
vfe_idx = msm_isp_get_vfe_idx_for_stream(vfe_dev,
|
||||||
stream_info);
|
stream_info);
|
||||||
for (plane = 0; plane < stream_info->num_planes;
|
for (plane = 0; plane < stream_info->num_planes;
|
||||||
|
|
|
@ -2830,6 +2830,10 @@ static int msm_isp_axi_update_cgc_override(struct vfe_device *vfe_dev_ioctl,
|
||||||
}
|
}
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev_ioctl,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev_ioctl,
|
||||||
HANDLE_TO_IDX(stream_cfg_cmd->stream_handle[i]));
|
HANDLE_TO_IDX(stream_cfg_cmd->stream_handle[i]));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s: stream_info is NULL", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
for (j = 0; j < stream_info->num_planes; j++) {
|
for (j = 0; j < stream_info->num_planes; j++) {
|
||||||
for (k = 0; k < stream_info->num_isp; k++) {
|
for (k = 0; k < stream_info->num_isp; k++) {
|
||||||
vfe_dev = stream_info->vfe_dev[k];
|
vfe_dev = stream_info->vfe_dev[k];
|
||||||
|
@ -3289,7 +3293,10 @@ static int msm_isp_stop_axi_stream(struct vfe_device *vfe_dev_ioctl,
|
||||||
continue;
|
continue;
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev_ioctl,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev_ioctl,
|
||||||
HANDLE_TO_IDX(stream_cfg_cmd->stream_handle[i]));
|
HANDLE_TO_IDX(stream_cfg_cmd->stream_handle[i]));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s: stream_info is NULL", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
spin_lock_irqsave(&stream_info->lock, flags);
|
spin_lock_irqsave(&stream_info->lock, flags);
|
||||||
rc = __msm_isp_check_stream_state(stream_info, 0);
|
rc = __msm_isp_check_stream_state(stream_info, 0);
|
||||||
spin_unlock_irqrestore(&stream_info->lock, flags);
|
spin_unlock_irqrestore(&stream_info->lock, flags);
|
||||||
|
@ -3326,6 +3333,10 @@ int msm_isp_cfg_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(stream_cfg_cmd->stream_handle[i]));
|
HANDLE_TO_IDX(stream_cfg_cmd->stream_handle[i]));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s: stream_info is NULL", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
vfe_idx = msm_isp_get_vfe_idx_for_stream_user(vfe_dev,
|
vfe_idx = msm_isp_get_vfe_idx_for_stream_user(vfe_dev,
|
||||||
stream_info);
|
stream_info);
|
||||||
if (vfe_idx == -ENOTTY || stream_info->stream_handle[vfe_idx] !=
|
if (vfe_idx == -ENOTTY || stream_info->stream_handle[vfe_idx] !=
|
||||||
|
@ -3845,6 +3856,11 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
}
|
}
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(update_info->stream_handle));
|
HANDLE_TO_IDX(update_info->stream_handle));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s:%d: stream_info is null",
|
||||||
|
__func__, __LINE__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
if (SRC_TO_INTF(stream_info->stream_src) >= VFE_SRC_MAX)
|
if (SRC_TO_INTF(stream_info->stream_src) >= VFE_SRC_MAX)
|
||||||
continue;
|
continue;
|
||||||
if (stream_info->state != ACTIVE &&
|
if (stream_info->state != ACTIVE &&
|
||||||
|
@ -3885,6 +3901,11 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
&update_cmd->update_info[i];
|
&update_cmd->update_info[i];
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(update_info->stream_handle));
|
HANDLE_TO_IDX(update_info->stream_handle));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s:%d: stream_info is null",
|
||||||
|
__func__, __LINE__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
stream_info->buf_divert = 0;
|
stream_info->buf_divert = 0;
|
||||||
msm_isp_get_timestamp(×tamp, vfe_dev);
|
msm_isp_get_timestamp(×tamp, vfe_dev);
|
||||||
frame_id = vfe_dev->axi_data.src_info[
|
frame_id = vfe_dev->axi_data.src_info[
|
||||||
|
@ -3919,6 +3940,11 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
&update_cmd->update_info[i];
|
&update_cmd->update_info[i];
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(update_info->stream_handle));
|
HANDLE_TO_IDX(update_info->stream_handle));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s:%d: stream_info is null",
|
||||||
|
__func__, __LINE__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
spin_lock_irqsave(&stream_info->lock, flags);
|
spin_lock_irqsave(&stream_info->lock, flags);
|
||||||
/* no change then break early */
|
/* no change then break early */
|
||||||
if (stream_info->current_framedrop_period ==
|
if (stream_info->current_framedrop_period ==
|
||||||
|
@ -3952,6 +3978,11 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
&update_cmd->update_info[i];
|
&update_cmd->update_info[i];
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(update_info->stream_handle));
|
HANDLE_TO_IDX(update_info->stream_handle));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s:%d: stream_info is null",
|
||||||
|
__func__, __LINE__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
sw_skip_info = &update_info->sw_skip_info;
|
sw_skip_info = &update_info->sw_skip_info;
|
||||||
if (sw_skip_info->stream_src_mask != 0) {
|
if (sw_skip_info->stream_src_mask != 0) {
|
||||||
/* SW image buffer drop */
|
/* SW image buffer drop */
|
||||||
|
@ -3976,6 +4007,11 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
&update_cmd->update_info[i];
|
&update_cmd->update_info[i];
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(update_info->stream_handle));
|
HANDLE_TO_IDX(update_info->stream_handle));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s:%d: stream_info is null",
|
||||||
|
__func__, __LINE__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
rc = msm_isp_stream_axi_cfg_update(vfe_dev, stream_info,
|
rc = msm_isp_stream_axi_cfg_update(vfe_dev, stream_info,
|
||||||
update_info);
|
update_info);
|
||||||
if (rc)
|
if (rc)
|
||||||
|
@ -4009,6 +4045,11 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
&update_cmd->update_info[i];
|
&update_cmd->update_info[i];
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(update_info->stream_handle));
|
HANDLE_TO_IDX(update_info->stream_handle));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s:%d: stream_info is null",
|
||||||
|
__func__, __LINE__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
rc = msm_isp_add_buf_queue(vfe_dev, stream_info,
|
rc = msm_isp_add_buf_queue(vfe_dev, stream_info,
|
||||||
update_info->user_stream_id);
|
update_info->user_stream_id);
|
||||||
if (rc)
|
if (rc)
|
||||||
|
@ -4023,6 +4064,11 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
&update_cmd->update_info[i];
|
&update_cmd->update_info[i];
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(update_info->stream_handle));
|
HANDLE_TO_IDX(update_info->stream_handle));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s:%d: stream_info is null",
|
||||||
|
__func__, __LINE__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
msm_isp_remove_buf_queue(vfe_dev, stream_info,
|
msm_isp_remove_buf_queue(vfe_dev, stream_info,
|
||||||
update_info->user_stream_id);
|
update_info->user_stream_id);
|
||||||
pr_debug("%s, Remove bufq for Stream 0x%x\n",
|
pr_debug("%s, Remove bufq for Stream 0x%x\n",
|
||||||
|
@ -4059,6 +4105,11 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
&update_cmd->update_info[i];
|
&update_cmd->update_info[i];
|
||||||
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
HANDLE_TO_IDX(update_info->stream_handle));
|
HANDLE_TO_IDX(update_info->stream_handle));
|
||||||
|
if (!stream_info) {
|
||||||
|
pr_err("%s:%d: stream_info is null",
|
||||||
|
__func__, __LINE__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
vfe_idx = msm_isp_get_vfe_idx_for_stream(
|
vfe_idx = msm_isp_get_vfe_idx_for_stream(
|
||||||
vfe_dev, stream_info);
|
vfe_dev, stream_info);
|
||||||
msm_isp_stream_axi_cfg_update(vfe_dev, stream_info,
|
msm_isp_stream_axi_cfg_update(vfe_dev, stream_info,
|
||||||
|
|
Loading…
Add table
Reference in a new issue