V4L/DVB (11961): tvp514x: try_count off by one
authorRoel Kluin <roel.kluin@gmail.com>
Thu, 11 Jun 2009 14:28:17 +0000 (11:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 22:07:39 +0000 (19:07 -0300)
With `while (try_count-- > 0)' try_count reaches -1 after the loop.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/tvp514x.c

index 4262e60..3750f7f 100644 (file)
@@ -692,7 +692,7 @@ static int ioctl_s_routing(struct v4l2_int_device *s,
                        break;  /* Input detected */
        }
 
-       if ((current_std == STD_INVALID) || (try_count <= 0))
+       if ((current_std == STD_INVALID) || (try_count < 0))
                return -EINVAL;
 
        decoder->current_std = current_std;