Skip to content

Commit

Permalink
staging: comedi: s526: fix if() check in s526_gpct_winsn()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent 54a2a02 commit 67f2021
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/s526.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 67f2021

Please sign in to comment.