[PATCH] staging: comedi: s526: fix if() check in s526_gpct_winsn()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/s526.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/s526.c b/drivers/staging/comedi/drivers/s526.c
index 4ad6adf..a1e2562 100644
--- a/drivers/staging/comedi/drivers/s526.c
+++ b/drivers/staging/comedi/drivers/s526.c
@@ -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 */
-- 
1.7.11

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux