Commit ba7ed691 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] v4l2-compat-ioctl32: VIDIOC_S_EDID should return all fields on error

Most ioctls do not have to write back the contents of the argument
if an error is returned. But VIDIOC_S_EDID is an exception together
with the EXT_CTRLS ioctls (already handled correctly).

Add this exception to v4l2-compat-ioctl32.

This fixes a compliance error when using compat32 and trying to
set a new EDID with more blocks than the hardware supports. In
that case the driver will return -E2BIG and set edid.blocks to the
actual maximum number of blocks. This field was never copied back
to userspace due to this bug.
Signed-off-by: default avatarHans Verkuil <hansverk@cisco.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 3369cde0
...@@ -990,6 +990,10 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar ...@@ -990,6 +990,10 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
if (put_v4l2_ext_controls32(&karg.v2ecs, up)) if (put_v4l2_ext_controls32(&karg.v2ecs, up))
err = -EFAULT; err = -EFAULT;
break; break;
case VIDIOC_S_EDID:
if (put_v4l2_edid32(&karg.v2edid, up))
err = -EFAULT;
break;
} }
if (err) if (err)
return err; return err;
...@@ -1011,7 +1015,6 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar ...@@ -1011,7 +1015,6 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
break; break;
case VIDIOC_G_EDID: case VIDIOC_G_EDID:
case VIDIOC_S_EDID:
err = put_v4l2_edid32(&karg.v2edid, up); err = put_v4l2_edid32(&karg.v2edid, up);
break; break;
......
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