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

Commit f3c6541b authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: crm: Fix the size to copy from user in IOCTL" into dev/msm-4.9-camx

parents 64cc6c84 7d11d89e
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&ses_info,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_req_mgr_session_info))) {
			return -EFAULT;
		}

@@ -245,7 +245,8 @@ static long cam_private_ioctl(struct file *file, void *fh,
		if (!rc)
			if (copy_to_user(
				u64_to_user_ptr(k_ioctl->handle),
				&ses_info, k_ioctl->size))
				&ses_info,
				sizeof(struct cam_req_mgr_session_info)))
				rc = -EFAULT;
		}
		break;
@@ -258,7 +259,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&ses_info,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_req_mgr_session_info))) {
			return -EFAULT;
		}

@@ -274,7 +275,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&link_info,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_req_mgr_link_info))) {
			return -EFAULT;
		}

@@ -282,7 +283,8 @@ static long cam_private_ioctl(struct file *file, void *fh,
		if (!rc)
			if (copy_to_user(
				u64_to_user_ptr(k_ioctl->handle),
				&link_info, k_ioctl->size))
				&link_info,
				sizeof(struct cam_req_mgr_link_info)))
				rc = -EFAULT;
		}
		break;
@@ -295,7 +297,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&unlink_info,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_req_mgr_unlink_info))) {
			return -EFAULT;
		}

@@ -311,7 +313,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&sched_req,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_req_mgr_sched_request))) {
			return -EFAULT;
		}

@@ -327,7 +329,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&flush_info,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_req_mgr_flush_info))) {
			return -EFAULT;
		}

@@ -343,7 +345,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&sync_info,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_req_mgr_sync_mode))) {
			return -EFAULT;
		}

@@ -358,7 +360,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&cmd,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_mem_mgr_alloc_cmd))) {
			rc = -EFAULT;
			break;
		}
@@ -367,7 +369,7 @@ static long cam_private_ioctl(struct file *file, void *fh,
		if (!rc)
			if (copy_to_user(
				u64_to_user_ptr(k_ioctl->handle),
				&cmd, k_ioctl->size)) {
				&cmd, sizeof(struct cam_mem_mgr_alloc_cmd))) {
				rc = -EFAULT;
				break;
			}
@@ -381,7 +383,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&cmd,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_mem_mgr_map_cmd))) {
			rc = -EFAULT;
			break;
		}
@@ -390,7 +392,7 @@ static long cam_private_ioctl(struct file *file, void *fh,
		if (!rc)
			if (copy_to_user(
				u64_to_user_ptr(k_ioctl->handle),
				&cmd, k_ioctl->size)) {
				&cmd, sizeof(struct cam_mem_mgr_map_cmd))) {
				rc = -EFAULT;
				break;
			}
@@ -404,7 +406,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&cmd,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_mem_mgr_release_cmd))) {
			rc = -EFAULT;
			break;
		}
@@ -420,7 +422,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&cmd,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_mem_cache_ops_cmd))) {
			rc = -EFAULT;
			break;
		}
@@ -438,7 +440,7 @@ static long cam_private_ioctl(struct file *file, void *fh,

		if (copy_from_user(&cmd,
			u64_to_user_ptr(k_ioctl->handle),
			k_ioctl->size)) {
			sizeof(struct cam_req_mgr_link_control))) {
			rc = -EFAULT;
			break;
		}