media: uvcvideo: Fix ENUMINPUT handling
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 21 Mar 2012 12:50:36 +0000 (09:50 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2012 07:15:52 +0000 (15:15 +0800)
commite2947ba083b522948032aa60b575ff10fd825586
tree47484142ab72490c722179b58f09202cfb2d25a8
parent9fc6d76cb43ea34715daa04841dc29f37c519fac
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>
drivers/media/video/uvc/uvc_v4l2.c