]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: comedi: s526: fix if() check in s526_gpct_winsn()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 24 Sep 2012 20:50:48 +0000 (13:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2012 17:21:43 +0000 (10:21 -0700)
This if() check was flipped from a test for valid data params
to a test for invalid params.

As pointed out by Dan Carpenter, the orignal test was:

if ((data[1] > data[0]) && (data[0] > 0)) {

the flipped test should be:

if (data[1] <= data[0]) ...

Add the missing '='.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/s526.c

index 4ad6adfcbb9cbf25ec05d48c5ec0a85f743e78c1..a1e256293bd670b5ebdacaf456041eb85c353a07 100644 (file)
@@ -376,7 +376,7 @@ static int s526_gpct_winsn(struct comedi_device *dev,
                   The above periods must be expressed as a multiple of the
                   pulse frequency on the selected source
                 */
-               if ((data[1] < data[0]) || !data[0])
+               if ((data[1] <= data[0]) || !data[0])
                        return -EINVAL;
 
                /* Fall thru to write the PULSE_WIDTH */