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

This commit is contained in:
Linux Build Service Account 2015-06-20 14:20:27 -07:00 committed by Gerrit - the friendly Code Review server
commit baf62f3802
1 changed files with 16 additions and 0 deletions

View File

@ -2192,6 +2192,9 @@ static int msm_cpp_cfg(struct cpp_device *cpp_dev,
struct msm_cpp_frame_info_t *frame = NULL;
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)))
@ -2203,6 +2206,12 @@ 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;
@ -2211,6 +2220,13 @@ static int msm_cpp_cfg(struct cpp_device *cpp_dev,
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;
}