Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7f07d3f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: cpp: Update output buffer index of userspace frame pointer"

parents bd3353b6 f7c0d155
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -2317,9 +2317,15 @@ static int msm_cpp_cfg(struct cpp_device *cpp_dev,
	struct msm_camera_v4l2_ioctl_t *ioctl_ptr)
{
	struct msm_cpp_frame_info_t *frame = NULL;
	struct msm_cpp_frame_info_t *u_frame_info =
	  (struct msm_cpp_frame_info_t *)ioctl_ptr->ioctl_ptr;
	struct msm_cpp_frame_info_t k_frame_info;
	int32_t rc = 0;
	int32_t i = 0;
	int32_t num_buff = sizeof(k_frame_info.output_buffer_info)/
		sizeof(struct msm_cpp_buffer_info_t);
	if (copy_from_user(&k_frame_info,
			(void __user *)ioctl_ptr->ioctl_ptr,
			sizeof(k_frame_info)))
			return -EFAULT;

	frame = msm_cpp_get_frame(ioctl_ptr);
	if (!frame) {
@@ -2327,14 +2333,27 @@ static int msm_cpp_cfg(struct cpp_device *cpp_dev,
		rc = -EINVAL;
	} else {
		rc = msm_cpp_cfg_frame(cpp_dev, frame);
		if (rc >= 0) {
			for (i = 0; i < num_buff; i++) {
				k_frame_info.output_buffer_info[i] =
					frame->output_buffer_info[i];
			}
		}
	}

	ioctl_ptr->trans_code = rc;

	if (copy_to_user((void __user *)u_frame_info->status, &rc,
	if (copy_to_user((void __user *)k_frame_info.status, &rc,
		sizeof(int32_t)))
		pr_err("error cannot copy error\n");


	if (copy_to_user((void __user *)ioctl_ptr->ioctl_ptr,
		&k_frame_info, sizeof(k_frame_info))) {
		pr_err("Error: cannot copy k_frame_info");
		return -EFAULT;
	}

	return rc;
}