[COMMON] media: v4l2-core: fix compat ioctl
authorJanghyuck Kim <janghyuck.kim@samsung.com>
Thu, 12 Apr 2018 06:18:12 +0000 (15:18 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:17 +0000 (20:22 +0300)
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 eeb71a5d9c85dcc081a000893616a7c5bd72d9d7..066751625dd9f4094e70cb945c79029c55ec3b13 100644 (file)
@@ -388,7 +388,7 @@ struct v4l2_buffer32 {
                __s32           fd;
        } m;
        __u32                   length;
-       __s32                   reserved2;
+       __u32                   reserved2;
        union {
                __u32           fence_fd;
                __u32           reserved;
@@ -612,7 +612,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;