Commit 96d06ba
media: uvcvideo: Fix dereference of out-of-bound list iterator
[ Upstream commit f875bcc ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 26a1c2d commit 96d06ba
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1848 | 1848 | | |
1849 | 1849 | | |
1850 | 1850 | | |
1851 | | - | |
| 1851 | + | |
| 1852 | + | |
1852 | 1853 | | |
1853 | 1854 | | |
1854 | 1855 | | |
1855 | 1856 | | |
1856 | 1857 | | |
1857 | 1858 | | |
| 1859 | + | |
1858 | 1860 | | |
1859 | 1861 | | |
1860 | | - | |
| 1862 | + | |
| 1863 | + | |
1861 | 1864 | | |
| 1865 | + | |
1862 | 1866 | | |
1863 | 1867 | | |
1864 | | - | |
| 1868 | + | |
1865 | 1869 | | |
1866 | 1870 | | |
1867 | 1871 | | |
1868 | 1872 | | |
1869 | 1873 | | |
1870 | 1874 | | |
| 1875 | + | |
1871 | 1876 | | |
1872 | 1877 | | |
1873 | 1878 | | |
1874 | | - | |
| 1879 | + | |
1875 | 1880 | | |
1876 | 1881 | | |
1877 | 1882 | | |
| |||
0 commit comments