mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
aeebb1b314
commit
31c5f0c5e2
|
@ -694,7 +694,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))
|
||||
|
|
Loading…
Reference in New Issue