media: uvcvideo: Fix dereference of out-of-bound list iterator
authorDaniel W. S. Almeida <dwlsalmeida@gmail.com>
Fri, 7 Aug 2020 08:35:30 +0000 (10:35 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 10 Sep 2020 12:06:27 +0000 (14:06 +0200)
commitf875bcc375c738bf2f599ff2e1c5b918dbd07c45
tree99629a389751d6642d5c050ed9c1d871c50925ff
parentf5a3048a840ddf94f651a2694d10aefd6b5f757d
media: uvcvideo: Fix dereference of out-of-bound list iterator

Fixes the following coccinelle report:

drivers/media/usb/uvc/uvc_ctrl.c:1860:5-11:
ERROR: invalid reference to the index variable of the iterator on line 1854

by adding a boolean variable to check if the loop has found the

Found using - Coccinelle (http://coccinelle.lip6.fr)

[Replace cursor variable with bool found]

Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/uvc/uvc_ctrl.c