aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-03-21 08:50:36 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-08 12:45:53 -0400
commit31c5f0c5e25ed71eeced170f113bb590f2f1f6f3 (patch)
tree73100c9b4f3fcf2fd556e0ed12a1707f3576a302 /drivers
parentaeebb1b3146a70bf02d0115a2be690d856d12e8c (diff)
[media] uvcvideo: Fix ENUMINPUT handling
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> Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.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 a3322ed81e39..759bef8897e9 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -694,7 +694,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
694 break; 694 break;
695 } 695 }
696 pin = iterm->id; 696 pin = iterm->id;
697 } else if (pin < selector->bNrInPins) { 697 } else if (index < selector->bNrInPins) {
698 pin = selector->baSourceID[index]; 698 pin = selector->baSourceID[index];
699 list_for_each_entry(iterm, &chain->entities, chain) { 699 list_for_each_entry(iterm, &chain->entities, chain) {
700 if (!UVC_ENTITY_IS_ITERM(iterm)) 700 if (!UVC_ENTITY_IS_ITERM(iterm))