Loading drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c +12 −7 Original line number Diff line number Diff line Loading @@ -2855,13 +2855,15 @@ end: return rc; } static int msm_cpp_validate_input(unsigned int cmd, void *arg, static int msm_cpp_validate_ioctl_input(unsigned int cmd, void *arg, struct msm_camera_v4l2_ioctl_t **ioctl_ptr) { switch (cmd) { case MSM_SD_SHUTDOWN: case MSM_SD_NOTIFY_FREEZE: case MSM_SD_UNNOTIFY_FREEZE: case VIDIOC_MSM_CPP_IOMMU_ATTACH: case VIDIOC_MSM_CPP_IOMMU_DETACH: break; default: { if (ioctl_ptr == NULL) { Loading @@ -2870,8 +2872,9 @@ static int msm_cpp_validate_input(unsigned int cmd, void *arg, } *ioctl_ptr = arg; if ((*ioctl_ptr == NULL) || (*ioctl_ptr)->ioctl_ptr == NULL) { if (((*ioctl_ptr) == NULL) || ((*ioctl_ptr)->ioctl_ptr == NULL) || ((*ioctl_ptr)->len == 0)) { pr_err("Error invalid ioctl argument cmd %u", cmd); return -EINVAL; } Loading Loading @@ -2903,7 +2906,7 @@ long msm_cpp_subdev_ioctl(struct v4l2_subdev *sd, return -EINVAL; } rc = msm_cpp_validate_input(cmd, arg, &ioctl_ptr); rc = msm_cpp_validate_ioctl_input(cmd, arg, &ioctl_ptr); if (rc != 0) { pr_err("input validation failed\n"); return rc; Loading Loading @@ -3396,7 +3399,7 @@ STREAM_BUFF_END: (cpp_dev->stream_cnt == 0)) { rc = cam_smmu_ops(cpp_dev->iommu_hdl, CAM_SMMU_DETACH); if (rc < 0) { pr_err("%s:%dError iommu atach failed\n", pr_err("%s:%dError iommu detach failed\n", __func__, __LINE__); rc = -EINVAL; break; Loading @@ -3405,6 +3408,7 @@ STREAM_BUFF_END: } else { pr_err("%s:%d IOMMMU attach triggered in invalid state\n", __func__, __LINE__); rc = -EINVAL; } break; } Loading Loading @@ -4037,7 +4041,8 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file, default: pr_err_ratelimited("%s: unsupported compat type :%x LOAD %lu\n", __func__, cmd, VIDIOC_MSM_CPP_LOAD_FIRMWARE); break; mutex_unlock(&cpp_dev->mutex); return -EINVAL; } mutex_unlock(&cpp_dev->mutex); Loading Loading @@ -4068,7 +4073,7 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file, default: pr_err_ratelimited("%s: unsupported compat type :%d\n", __func__, cmd); break; return -EINVAL; } if (is_copytouser_req) { Loading Loading
drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c +12 −7 Original line number Diff line number Diff line Loading @@ -2855,13 +2855,15 @@ end: return rc; } static int msm_cpp_validate_input(unsigned int cmd, void *arg, static int msm_cpp_validate_ioctl_input(unsigned int cmd, void *arg, struct msm_camera_v4l2_ioctl_t **ioctl_ptr) { switch (cmd) { case MSM_SD_SHUTDOWN: case MSM_SD_NOTIFY_FREEZE: case MSM_SD_UNNOTIFY_FREEZE: case VIDIOC_MSM_CPP_IOMMU_ATTACH: case VIDIOC_MSM_CPP_IOMMU_DETACH: break; default: { if (ioctl_ptr == NULL) { Loading @@ -2870,8 +2872,9 @@ static int msm_cpp_validate_input(unsigned int cmd, void *arg, } *ioctl_ptr = arg; if ((*ioctl_ptr == NULL) || (*ioctl_ptr)->ioctl_ptr == NULL) { if (((*ioctl_ptr) == NULL) || ((*ioctl_ptr)->ioctl_ptr == NULL) || ((*ioctl_ptr)->len == 0)) { pr_err("Error invalid ioctl argument cmd %u", cmd); return -EINVAL; } Loading Loading @@ -2903,7 +2906,7 @@ long msm_cpp_subdev_ioctl(struct v4l2_subdev *sd, return -EINVAL; } rc = msm_cpp_validate_input(cmd, arg, &ioctl_ptr); rc = msm_cpp_validate_ioctl_input(cmd, arg, &ioctl_ptr); if (rc != 0) { pr_err("input validation failed\n"); return rc; Loading Loading @@ -3396,7 +3399,7 @@ STREAM_BUFF_END: (cpp_dev->stream_cnt == 0)) { rc = cam_smmu_ops(cpp_dev->iommu_hdl, CAM_SMMU_DETACH); if (rc < 0) { pr_err("%s:%dError iommu atach failed\n", pr_err("%s:%dError iommu detach failed\n", __func__, __LINE__); rc = -EINVAL; break; Loading @@ -3405,6 +3408,7 @@ STREAM_BUFF_END: } else { pr_err("%s:%d IOMMMU attach triggered in invalid state\n", __func__, __LINE__); rc = -EINVAL; } break; } Loading Loading @@ -4037,7 +4041,8 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file, default: pr_err_ratelimited("%s: unsupported compat type :%x LOAD %lu\n", __func__, cmd, VIDIOC_MSM_CPP_LOAD_FIRMWARE); break; mutex_unlock(&cpp_dev->mutex); return -EINVAL; } mutex_unlock(&cpp_dev->mutex); Loading Loading @@ -4068,7 +4073,7 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file, default: pr_err_ratelimited("%s: unsupported compat type :%d\n", __func__, cmd); break; return -EINVAL; } if (is_copytouser_req) { Loading