aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-03-21 08:50:36 -0400
committerLuis Henriques <luis.henriques@canonical.com>2012-06-12 05:59:16 -0400
commit8d7aab60cf64a080e0fdab6efa76f3085a562787 (patch)
tree9f6b822130dc2ac65daa7543a941f9c94383a222 /drivers
parentfe6a6731f181a26b5486a7c7b512ba600ef49468 (diff)
media: uvcvideo: Fix ENUMINPUT handling
BugLink: http://bugs.launchpad.net/bugs/1008697 commit 31c5f0c5e25ed71eeced170f113bb590f2f1f6f3 upstream. Properly validate the user-supplied index against the number of inputs. The code used the pin local variable instead of the index by mistake. Reported-by: Jozef Vesely <vesely@gjh.sk> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index dbefdb09c10..5afdbb7bbea 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -710,7 +710,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
710 break; 710 break;
711 } 711 }
712 pin = iterm->id; 712 pin = iterm->id;
713 } else if (pin < selector->bNrInPins) { 713 } else if (index < selector->bNrInPins) {
714 pin = selector->baSourceID[index]; 714 pin = selector->baSourceID[index];
715 list_for_each_entry(iterm, &chain->entities, chain) { 715 list_for_each_entry(iterm, &chain->entities, chain) {
716 if (!UVC_ENTITY_IS_ITERM(iterm)) 716 if (!UVC_ENTITY_IS_ITERM(iterm))