aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJonathan Corbet <corbet-v4l@lwn.net>2006-09-25 19:25:37 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-25 20:38:36 -0400
commitb7de567bf3187ccf776e2fe0e241593cdcba5459 (patch)
treec9420517d6a133121d13395dd21b729e6b26f40a /drivers/media
parent1cc5f7142eca352109895fe20b1fc6405dd17727 (diff)
[PATCH] VIDIOC_ENUMSTD bug
The v4l2 API documentation for VIDIOC_ENUMSTD says: To enumerate all standards applications shall begin at index zero, incrementing by one until the driver returns EINVAL. The actual code, however, tests the index this way: if (index<=0 || index >= vfd->tvnormsize) { ret=-EINVAL; So any application which passes in index=0 gets EINVAL right off the bat - and, in fact, this is what happens to mplayer. So I think the following patch is called for, and maybe even appropriate for a 2.6.18.x stable release. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/videodev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 88bf2af2a0e7..edd7b83c3464 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -836,7 +836,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
836 break; 836 break;
837 } 837 }
838 838
839 if (index<=0 || index >= vfd->tvnormsize) { 839 if (index < 0 || index >= vfd->tvnormsize) {
840 ret=-EINVAL; 840 ret=-EINVAL;
841 break; 841 break;
842 } 842 }