diff options
| author | Arun Menon <avmenon@codeaurora.org> | 2014-02-05 13:44:21 -0800 |
|---|---|---|
| committer | Jeevan Shriram <jshriram@codeaurora.org> | 2016-05-11 17:44:10 -0700 |
| commit | be489cec86ea28e968993718b6f2a5e04733e79d (patch) | |
| tree | 40e88bef67c283e85fd6bf16dfe38dc4d69c4cc1 | |
| parent | 892adf69609ddd31dbdc09bd3b34b5f10a0be594 (diff) | |
[media] v4l: Update v4l2 32bit structures
Update v4l2_event32 structure with updated elements
from v4l2_event structure. Also copy and update
reserved and other fields during 32 bit ioctl handling.
CRs-Fixed: 1013345
Change-Id: I3038a2c0c7f2b7f13c412dc04890744d8dbe37ee
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
| -rw-r--r-- | drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 327e83ac2469..fc9e4395c21d 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -359,6 +359,10 @@ static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __ if (copy_in_user(up, up32, 2 * sizeof(__u32)) || copy_in_user(&up->data_offset, &up32->data_offset, + sizeof(__u32)) || + copy_in_user(up->reserved, up32->reserved, + sizeof(up->reserved)) || + copy_in_user(&up->length, &up32->length, sizeof(__u32))) return -EFAULT; @@ -384,6 +388,8 @@ static int put_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __ enum v4l2_memory memory) { if (copy_in_user(up32, up, 2 * sizeof(__u32)) || + copy_in_user(up32->reserved, up->reserved, + sizeof(up32->reserved)) || copy_in_user(&up32->data_offset, &up->data_offset, sizeof(__u32))) return -EFAULT; @@ -399,6 +405,10 @@ static int put_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __ if (copy_in_user(&up32->m.fd, &up->m.fd, sizeof(int))) return -EFAULT; + if (memory == V4L2_MEMORY_USERPTR) + if (copy_in_user(&up32->m.userptr, &up->m.userptr, + sizeof(compat_long_t))) + return -EFAULT; return 0; } @@ -760,8 +770,13 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext struct v4l2_event32 { __u32 type; union { - compat_s64 value64; - __u8 data[64]; + struct v4l2_event_vsync vsync; + struct v4l2_event_ctrl ctrl; + struct v4l2_event_frame_sync frame_sync; + struct v4l2_event_src_change src_change; + struct v4l2_event_motion_det motion_det; + compat_s64 value64; + __u8 data[64]; } u; __u32 pending; __u32 sequence; |
