lkml.org 
[lkml]   [2006]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 48/67] Fix VIDIOC_ENUMSTD bug

-stable review patch. If anyone has any objections, please let us know.

------------------
From: Jonathan Corbet <corbet-v4l@lwn.net>

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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
drivers/media/video/videodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.18.orig/drivers/media/video/videodev.c
+++ linux-2.6.18/drivers/media/video/videodev.c
@@ -836,7 +836,7 @@ static int __video_do_ioctl(struct inode
break;
}

- if (index<=0 || index >= vfd->tvnormsize) {
+ if (index < 0 || index >= vfd->tvnormsize) {
ret=-EINVAL;
break;
}
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-11 23:25    [W:0.304 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site