The patch number 11260 was added via Trent Piepho <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel
If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List <[email protected]>
------
From: Trent Piepho <[email protected]>
v4l2-ioctl: Check format for S_PARM and G_PARM
Return EINVAL if VIDIOC_S/G_PARM is called for a buffer type that the
driver doesn't define a ->vidioc_try_fmt_XXX() method for. Several other
ioctls, like QUERYBUF, QBUF, and DQBUF, etc. do this too. It saves each
driver from having to check if the buffer type is one that it supports.
Priority: normal
Signed-off-by: Trent Piepho <[email protected]>
---
linux/drivers/media/video/v4l2-ioctl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff -r 346bab8698ea -r 44632c5fe5b2 linux/drivers/media/video/v4l2-ioctl.c
--- a/linux/drivers/media/video/v4l2-ioctl.c Sat Mar 28 18:25:35 2009 -0700
+++ b/linux/drivers/media/video/v4l2-ioctl.c Sat Mar 28 18:25:35 2009 -0700
@@ -1552,6 +1552,9 @@ static long __video_do_ioctl(struct file
struct v4l2_streamparm *p = arg;
if (ops->vidioc_g_parm) {
+ ret = check_fmt(ops, p->type);
+ if (ret)
+ break;
ret = ops->vidioc_g_parm(file, fh, p);
} else {
if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
@@ -1571,6 +1574,10 @@ static long __video_do_ioctl(struct file
if (!ops->vidioc_s_parm)
break;
+ ret = check_fmt(ops, p->type);
+ if (ret)
+ break;
+
dbgarg(cmd, "type=%d\n", p->type);
ret = ops->vidioc_s_parm(file, fh, p);
break;
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/44632c5fe5b2cd973c75501a88d61b43a39f6c43
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits