[COMMON] media: v4l2-core: fix compat ioctl
authorJanghyuck Kim <janghyuck.kim@samsung.com>
Thu, 12 Apr 2018 06:18:12 +0000 (15:18 +0900)
committerSeungchul Kim <sc377.kim@samsung.com>
Mon, 28 May 2018 05:28:46 +0000 (14:28 +0900)
Copying reserved2 field was missed, and signedness of reserved2 field
was chagned. This patch corrected these bugs.

Change-Id: Ia04ead949d34c42392efab2200fc1ca78a0d64b8
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
drivers/media/v4l2-core/v4l2-compat-ioctl32.c

index 8da921c6dbd7570dab049e58b31433d80dd76392..371612be2787da13738b89ac56245768f50e0557 100644 (file)
@@ -386,7 +386,7 @@ struct v4l2_buffer32 {
                __s32           fd;
        } m;
        __u32                   length;
-       __s32                   reserved2;
+       __u32                   reserved2;
        union {
                __u32           fence_fd;
                __u32           reserved;
@@ -610,7 +610,7 @@ static int put_v4l2_buffer32(struct v4l2_buffer __user *kp,
            copy_in_user(&up->timecode, &kp->timecode, sizeof(kp->timecode)) ||
            assign_in_user(&up->sequence, &kp->sequence) ||
            assign_in_user(&up->fence_fd, &kp->fence_fd) ||
-           assign_in_user(&up->reserved, &kp->reserved) ||
+           assign_in_user(&up->reserved2, &kp->reserved2) ||
            get_user(length, &kp->length) ||
            put_user(length, &up->length))
                return -EFAULT;