diff options
author | 2012-03-21 09:50:36 -0300 | |
---|---|---|
committer | 2012-06-01 15:15:52 +0800 | |
commit | e2947ba083b522948032aa60b575ff10fd825586 (patch) | |
tree | 47484142ab72490c722179b58f09202cfb2d25a8 | |
parent | smsusb: add autodetection support for USB ID 2040:c0a0 (diff) | |
download | linux-stable-e2947ba083b522948032aa60b575ff10fd825586.tar.xz linux-stable-e2947ba083b522948032aa60b575ff10fd825586.zip |
media: uvcvideo: Fix ENUMINPUT handling
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>
-rw-r--r-- | drivers/media/video/uvc/uvc_v4l2.c | 2 |
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 2ae4f880ea05..dca9f9bb5a77 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c @@ -686,7 +686,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) break; } pin = iterm->id; - } else if (pin < selector->bNrInPins) { + } else if (index < selector->bNrInPins) { pin = selector->baSourceID[index]; list_for_each_entry(iterm, &chain->entities, chain) { if (!UVC_ENTITY_IS_ITERM(iterm)) |