Commit 02129c9b authored by Hans Verkuil's avatar Hans Verkuil Committed by Greg Kroah-Hartman

media: v4l2-compat-ioctl32.c: fix the indentation

commit b7b957d4 upstream.

The indentation of this source is all over the place. Fix this.
This patch only changes whitespace.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f294548d
...@@ -48,11 +48,11 @@ struct v4l2_window32 { ...@@ -48,11 +48,11 @@ struct v4l2_window32 {
static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up)
{ {
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_window32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_window32)) ||
copy_from_user(&kp->w, &up->w, sizeof(up->w)) || copy_from_user(&kp->w, &up->w, sizeof(up->w)) ||
get_user(kp->field, &up->field) || get_user(kp->field, &up->field) ||
get_user(kp->chromakey, &up->chromakey) || get_user(kp->chromakey, &up->chromakey) ||
get_user(kp->clipcount, &up->clipcount)) get_user(kp->clipcount, &up->clipcount))
return -EFAULT; return -EFAULT;
if (kp->clipcount > 2048) if (kp->clipcount > 2048)
return -EINVAL; return -EINVAL;
if (kp->clipcount) { if (kp->clipcount) {
...@@ -82,10 +82,10 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user ...@@ -82,10 +82,10 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user
static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up)
{ {
if (copy_to_user(&up->w, &kp->w, sizeof(kp->w)) || if (copy_to_user(&up->w, &kp->w, sizeof(kp->w)) ||
put_user(kp->field, &up->field) || put_user(kp->field, &up->field) ||
put_user(kp->chromakey, &up->chromakey) || put_user(kp->chromakey, &up->chromakey) ||
put_user(kp->clipcount, &up->clipcount)) put_user(kp->clipcount, &up->clipcount))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -97,7 +97,7 @@ static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pi ...@@ -97,7 +97,7 @@ static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pi
} }
static inline int get_v4l2_pix_format_mplane(struct v4l2_pix_format_mplane *kp, static inline int get_v4l2_pix_format_mplane(struct v4l2_pix_format_mplane *kp,
struct v4l2_pix_format_mplane __user *up) struct v4l2_pix_format_mplane __user *up)
{ {
if (copy_from_user(kp, up, sizeof(struct v4l2_pix_format_mplane))) if (copy_from_user(kp, up, sizeof(struct v4l2_pix_format_mplane)))
return -EFAULT; return -EFAULT;
...@@ -112,7 +112,7 @@ static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pi ...@@ -112,7 +112,7 @@ static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pi
} }
static inline int put_v4l2_pix_format_mplane(struct v4l2_pix_format_mplane *kp, static inline int put_v4l2_pix_format_mplane(struct v4l2_pix_format_mplane *kp,
struct v4l2_pix_format_mplane __user *up) struct v4l2_pix_format_mplane __user *up)
{ {
if (copy_to_user(up, kp, sizeof(struct v4l2_pix_format_mplane))) if (copy_to_user(up, kp, sizeof(struct v4l2_pix_format_mplane)))
return -EFAULT; return -EFAULT;
...@@ -218,7 +218,7 @@ static int __get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us ...@@ -218,7 +218,7 @@ static int __get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us
return get_v4l2_sdr_format(&kp->fmt.sdr, &up->fmt.sdr); return get_v4l2_sdr_format(&kp->fmt.sdr, &up->fmt.sdr);
default: default:
pr_info("compat_ioctl32: unexpected VIDIOC_FMT type %d\n", pr_info("compat_ioctl32: unexpected VIDIOC_FMT type %d\n",
kp->type); kp->type);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -265,7 +265,7 @@ static int __put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us ...@@ -265,7 +265,7 @@ static int __put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us
return put_v4l2_sdr_format(&kp->fmt.sdr, &up->fmt.sdr); return put_v4l2_sdr_format(&kp->fmt.sdr, &up->fmt.sdr);
default: default:
pr_info("compat_ioctl32: unexpected VIDIOC_FMT type %d\n", pr_info("compat_ioctl32: unexpected VIDIOC_FMT type %d\n",
kp->type); kp->type);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -299,7 +299,7 @@ static int get_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 ...@@ -299,7 +299,7 @@ static int get_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32
{ {
/* other fields are not set by the user, nor used by the driver */ /* other fields are not set by the user, nor used by the driver */
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard32)) ||
get_user(kp->index, &up->index)) get_user(kp->index, &up->index))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -307,13 +307,13 @@ static int get_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 ...@@ -307,13 +307,13 @@ static int get_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32
static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 __user *up) static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 __user *up)
{ {
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard32)) ||
put_user(kp->index, &up->index) || put_user(kp->index, &up->index) ||
put_user(kp->id, &up->id) || put_user(kp->id, &up->id) ||
copy_to_user(up->name, kp->name, 24) || copy_to_user(up->name, kp->name, 24) ||
copy_to_user(&up->frameperiod, &kp->frameperiod, sizeof(kp->frameperiod)) || copy_to_user(&up->frameperiod, &kp->frameperiod, sizeof(kp->frameperiod)) ||
put_user(kp->framelines, &up->framelines) || put_user(kp->framelines, &up->framelines) ||
copy_to_user(up->reserved, kp->reserved, 4 * sizeof(__u32))) copy_to_user(up->reserved, kp->reserved, 4 * sizeof(__u32)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -353,14 +353,14 @@ struct v4l2_buffer32 { ...@@ -353,14 +353,14 @@ struct v4l2_buffer32 {
}; };
static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __user *up32, static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __user *up32,
enum v4l2_memory memory) enum v4l2_memory memory)
{ {
void __user *up_pln; void __user *up_pln;
compat_long_t p; compat_long_t p;
if (copy_in_user(up, up32, 2 * sizeof(__u32)) || if (copy_in_user(up, up32, 2 * sizeof(__u32)) ||
copy_in_user(&up->data_offset, &up32->data_offset, copy_in_user(&up->data_offset, &up32->data_offset,
sizeof(__u32))) sizeof(__u32)))
return -EFAULT; return -EFAULT;
if (memory == V4L2_MEMORY_USERPTR) { if (memory == V4L2_MEMORY_USERPTR) {
...@@ -374,7 +374,7 @@ static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __ ...@@ -374,7 +374,7 @@ static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __
return -EFAULT; return -EFAULT;
} else { } else {
if (copy_in_user(&up->m.mem_offset, &up32->m.mem_offset, if (copy_in_user(&up->m.mem_offset, &up32->m.mem_offset,
sizeof(__u32))) sizeof(__u32)))
return -EFAULT; return -EFAULT;
} }
...@@ -382,23 +382,23 @@ static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __ ...@@ -382,23 +382,23 @@ static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __
} }
static int put_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __user *up32, static int put_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __user *up32,
enum v4l2_memory memory) enum v4l2_memory memory)
{ {
if (copy_in_user(up32, up, 2 * sizeof(__u32)) || if (copy_in_user(up32, up, 2 * sizeof(__u32)) ||
copy_in_user(&up32->data_offset, &up->data_offset, copy_in_user(&up32->data_offset, &up->data_offset,
sizeof(__u32))) sizeof(__u32)))
return -EFAULT; return -EFAULT;
/* For MMAP, driver might've set up the offset, so copy it back. /* For MMAP, driver might've set up the offset, so copy it back.
* USERPTR stays the same (was userspace-provided), so no copying. */ * USERPTR stays the same (was userspace-provided), so no copying. */
if (memory == V4L2_MEMORY_MMAP) if (memory == V4L2_MEMORY_MMAP)
if (copy_in_user(&up32->m.mem_offset, &up->m.mem_offset, if (copy_in_user(&up32->m.mem_offset, &up->m.mem_offset,
sizeof(__u32))) sizeof(__u32)))
return -EFAULT; return -EFAULT;
/* For DMABUF, driver might've set up the fd, so copy it back. */ /* For DMABUF, driver might've set up the fd, so copy it back. */
if (memory == V4L2_MEMORY_DMABUF) if (memory == V4L2_MEMORY_DMABUF)
if (copy_in_user(&up32->m.fd, &up->m.fd, if (copy_in_user(&up32->m.fd, &up->m.fd,
sizeof(int))) sizeof(int)))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -413,19 +413,19 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user ...@@ -413,19 +413,19 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
int ret; int ret;
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_buffer32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_buffer32)) ||
get_user(kp->index, &up->index) || get_user(kp->index, &up->index) ||
get_user(kp->type, &up->type) || get_user(kp->type, &up->type) ||
get_user(kp->flags, &up->flags) || get_user(kp->flags, &up->flags) ||
get_user(kp->memory, &up->memory) || get_user(kp->memory, &up->memory) ||
get_user(kp->length, &up->length)) get_user(kp->length, &up->length))
return -EFAULT; return -EFAULT;
if (V4L2_TYPE_IS_OUTPUT(kp->type)) if (V4L2_TYPE_IS_OUTPUT(kp->type))
if (get_user(kp->bytesused, &up->bytesused) || if (get_user(kp->bytesused, &up->bytesused) ||
get_user(kp->field, &up->field) || get_user(kp->field, &up->field) ||
get_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) || get_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) ||
get_user(kp->timestamp.tv_usec, get_user(kp->timestamp.tv_usec,
&up->timestamp.tv_usec)) &up->timestamp.tv_usec))
return -EFAULT; return -EFAULT;
if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) { if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) {
...@@ -442,13 +442,13 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user ...@@ -442,13 +442,13 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
uplane32 = compat_ptr(p); uplane32 = compat_ptr(p);
if (!access_ok(VERIFY_READ, uplane32, if (!access_ok(VERIFY_READ, uplane32,
num_planes * sizeof(struct v4l2_plane32))) num_planes * sizeof(struct v4l2_plane32)))
return -EFAULT; return -EFAULT;
/* We don't really care if userspace decides to kill itself /* We don't really care if userspace decides to kill itself
* by passing a very big num_planes value */ * by passing a very big num_planes value */
uplane = compat_alloc_user_space(num_planes * uplane = compat_alloc_user_space(num_planes *
sizeof(struct v4l2_plane)); sizeof(struct v4l2_plane));
kp->m.planes = (__force struct v4l2_plane *)uplane; kp->m.planes = (__force struct v4l2_plane *)uplane;
while (--num_planes >= 0) { while (--num_planes >= 0) {
...@@ -466,12 +466,12 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user ...@@ -466,12 +466,12 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
break; break;
case V4L2_MEMORY_USERPTR: case V4L2_MEMORY_USERPTR:
{ {
compat_long_t tmp; compat_long_t tmp;
if (get_user(tmp, &up->m.userptr)) if (get_user(tmp, &up->m.userptr))
return -EFAULT; return -EFAULT;
kp->m.userptr = (unsigned long)compat_ptr(tmp); kp->m.userptr = (unsigned long)compat_ptr(tmp);
} }
break; break;
case V4L2_MEMORY_OVERLAY: case V4L2_MEMORY_OVERLAY:
...@@ -497,22 +497,22 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user ...@@ -497,22 +497,22 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
int ret; int ret;
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_buffer32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_buffer32)) ||
put_user(kp->index, &up->index) || put_user(kp->index, &up->index) ||
put_user(kp->type, &up->type) || put_user(kp->type, &up->type) ||
put_user(kp->flags, &up->flags) || put_user(kp->flags, &up->flags) ||
put_user(kp->memory, &up->memory)) put_user(kp->memory, &up->memory))
return -EFAULT; return -EFAULT;
if (put_user(kp->bytesused, &up->bytesused) || if (put_user(kp->bytesused, &up->bytesused) ||
put_user(kp->field, &up->field) || put_user(kp->field, &up->field) ||
put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) || put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) ||
put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) || put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) ||
copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) || copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) ||
put_user(kp->sequence, &up->sequence) || put_user(kp->sequence, &up->sequence) ||
put_user(kp->reserved2, &up->reserved2) || put_user(kp->reserved2, &up->reserved2) ||
put_user(kp->reserved, &up->reserved) || put_user(kp->reserved, &up->reserved) ||
put_user(kp->length, &up->length)) put_user(kp->length, &up->length))
return -EFAULT; return -EFAULT;
if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) { if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) {
num_planes = kp->length; num_planes = kp->length;
...@@ -576,11 +576,11 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame ...@@ -576,11 +576,11 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
u32 tmp; u32 tmp;
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_framebuffer32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_framebuffer32)) ||
get_user(tmp, &up->base) || get_user(tmp, &up->base) ||
get_user(kp->capability, &up->capability) || get_user(kp->capability, &up->capability) ||
get_user(kp->flags, &up->flags) || get_user(kp->flags, &up->flags) ||
copy_from_user(&kp->fmt, &up->fmt, sizeof(up->fmt))) copy_from_user(&kp->fmt, &up->fmt, sizeof(up->fmt)))
return -EFAULT; return -EFAULT;
kp->base = (__force void *)compat_ptr(tmp); kp->base = (__force void *)compat_ptr(tmp);
return 0; return 0;
} }
...@@ -590,11 +590,11 @@ static int put_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame ...@@ -590,11 +590,11 @@ static int put_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
u32 tmp = (u32)((unsigned long)kp->base); u32 tmp = (u32)((unsigned long)kp->base);
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_framebuffer32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_framebuffer32)) ||
put_user(tmp, &up->base) || put_user(tmp, &up->base) ||
put_user(kp->capability, &up->capability) || put_user(kp->capability, &up->capability) ||
put_user(kp->flags, &up->flags) || put_user(kp->flags, &up->flags) ||
copy_to_user(&up->fmt, &kp->fmt, sizeof(up->fmt))) copy_to_user(&up->fmt, &kp->fmt, sizeof(up->fmt)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -669,12 +669,12 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext ...@@ -669,12 +669,12 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
compat_caddr_t p; compat_caddr_t p;
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_ext_controls32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_ext_controls32)) ||
get_user(kp->which, &up->which) || get_user(kp->which, &up->which) ||
get_user(kp->count, &up->count) || get_user(kp->count, &up->count) ||
get_user(kp->error_idx, &up->error_idx) || get_user(kp->error_idx, &up->error_idx) ||
copy_from_user(kp->reserved, up->reserved, copy_from_user(kp->reserved, up->reserved,
sizeof(kp->reserved))) sizeof(kp->reserved)))
return -EFAULT; return -EFAULT;
n = kp->count; n = kp->count;
if (n == 0) { if (n == 0) {
kp->controls = NULL; kp->controls = NULL;
...@@ -684,7 +684,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext ...@@ -684,7 +684,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
return -EFAULT; return -EFAULT;
ucontrols = compat_ptr(p); ucontrols = compat_ptr(p);
if (!access_ok(VERIFY_READ, ucontrols, if (!access_ok(VERIFY_READ, ucontrols,
n * sizeof(struct v4l2_ext_control32))) n * sizeof(struct v4l2_ext_control32)))
return -EFAULT; return -EFAULT;
kcontrols = compat_alloc_user_space(n * sizeof(struct v4l2_ext_control)); kcontrols = compat_alloc_user_space(n * sizeof(struct v4l2_ext_control));
kp->controls = (__force struct v4l2_ext_control *)kcontrols; kp->controls = (__force struct v4l2_ext_control *)kcontrols;
...@@ -719,11 +719,11 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext ...@@ -719,11 +719,11 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
compat_caddr_t p; compat_caddr_t p;
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_ext_controls32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_ext_controls32)) ||
put_user(kp->which, &up->which) || put_user(kp->which, &up->which) ||
put_user(kp->count, &up->count) || put_user(kp->count, &up->count) ||
put_user(kp->error_idx, &up->error_idx) || put_user(kp->error_idx, &up->error_idx) ||
copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved))) copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved)))
return -EFAULT; return -EFAULT;
if (!kp->count) if (!kp->count)
return 0; return 0;
...@@ -731,7 +731,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext ...@@ -731,7 +731,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
return -EFAULT; return -EFAULT;
ucontrols = compat_ptr(p); ucontrols = compat_ptr(p);
if (!access_ok(VERIFY_WRITE, ucontrols, if (!access_ok(VERIFY_WRITE, ucontrols,
n * sizeof(struct v4l2_ext_control32))) n * sizeof(struct v4l2_ext_control32)))
return -EFAULT; return -EFAULT;
while (--n >= 0) { while (--n >= 0) {
...@@ -769,15 +769,15 @@ struct v4l2_event32 { ...@@ -769,15 +769,15 @@ struct v4l2_event32 {
static int put_v4l2_event32(struct v4l2_event *kp, struct v4l2_event32 __user *up) static int put_v4l2_event32(struct v4l2_event *kp, struct v4l2_event32 __user *up)
{ {
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_event32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_event32)) ||
put_user(kp->type, &up->type) || put_user(kp->type, &up->type) ||
copy_to_user(&up->u, &kp->u, sizeof(kp->u)) || copy_to_user(&up->u, &kp->u, sizeof(kp->u)) ||
put_user(kp->pending, &up->pending) || put_user(kp->pending, &up->pending) ||
put_user(kp->sequence, &up->sequence) || put_user(kp->sequence, &up->sequence) ||
put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) || put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) ||
put_user(kp->timestamp.tv_nsec, &up->timestamp.tv_nsec) || put_user(kp->timestamp.tv_nsec, &up->timestamp.tv_nsec) ||
put_user(kp->id, &up->id) || put_user(kp->id, &up->id) ||
copy_to_user(up->reserved, kp->reserved, 8 * sizeof(__u32))) copy_to_user(up->reserved, kp->reserved, 8 * sizeof(__u32)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -794,12 +794,12 @@ static int get_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up) ...@@ -794,12 +794,12 @@ static int get_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up)
u32 tmp; u32 tmp;
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_edid32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_edid32)) ||
get_user(kp->pad, &up->pad) || get_user(kp->pad, &up->pad) ||
get_user(kp->start_block, &up->start_block) || get_user(kp->start_block, &up->start_block) ||
get_user(kp->blocks, &up->blocks) || get_user(kp->blocks, &up->blocks) ||
get_user(tmp, &up->edid) || get_user(tmp, &up->edid) ||
copy_from_user(kp->reserved, up->reserved, sizeof(kp->reserved))) copy_from_user(kp->reserved, up->reserved, sizeof(kp->reserved)))
return -EFAULT; return -EFAULT;
kp->edid = (__force u8 *)compat_ptr(tmp); kp->edid = (__force u8 *)compat_ptr(tmp);
return 0; return 0;
} }
...@@ -809,12 +809,12 @@ static int put_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up) ...@@ -809,12 +809,12 @@ static int put_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up)
u32 tmp = (u32)((unsigned long)kp->edid); u32 tmp = (u32)((unsigned long)kp->edid);
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_edid32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_edid32)) ||
put_user(kp->pad, &up->pad) || put_user(kp->pad, &up->pad) ||
put_user(kp->start_block, &up->start_block) || put_user(kp->start_block, &up->start_block) ||
put_user(kp->blocks, &up->blocks) || put_user(kp->blocks, &up->blocks) ||
put_user(tmp, &up->edid) || put_user(tmp, &up->edid) ||
copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved))) copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment