]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
V4L/DVB (11660): zoran: fix bug when enumerating format -1
authorTrent Piepho <xyzzy@speakeasy.org>
Fri, 1 May 2009 00:03:34 +0000 (21:03 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 9 May 2009 21:50:54 +0000 (18:50 -0300)
commit171f48e254339548a910867c7a77c4a4d16e7e16
tree6a1fd40b20b6e7cc2116e1a567aa857ab56dd099
parentcb1287a82281ab3ddb0768250a46603977075b91
V4L/DVB (11660): zoran: fix bug when enumerating format -1

If someone requests a format at fmt->index == (unsigned)-1 and the first
format in the array doesn't have the requested type then num will still be
-1 when it's compared to fmt->index and there will appear to be a match.

Restructure the loop so this can't happen.  It's simpler this way too.  The
unnecessary check for (unsigned)fmt->index < 0 found by Roel Kluin
<roel.kluin@gmail.com> is removed this way too.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/zoran/zoran_driver.c