[PATCH 65/77] staging: comedi: usbduxsigma: check for invalid 'ao_timer' in all cases

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

 



Make sure to check that the 'ao_timer' value is valid for both the
high speed and low speed cases in usbduxsigma_ao_cmdtest().

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/usbduxsigma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
index ed5085a7..aa0090c 100644
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
@@ -994,9 +994,9 @@ static int usbduxsigma_ao_cmdtest(struct comedi_device *dev,
 		 * we get all channels at once
 		 */
 		devpriv->ao_timer = cmd->scan_begin_arg / 1000000;
-		if (devpriv->ao_timer < 1)
-			err |= -EINVAL;
 	}
+	if (devpriv->ao_timer < 1)
+		err |= -EINVAL;
 
 	if (cmd->stop_src == TRIG_COUNT) {
 		/* not continuous, use counter */
-- 
1.8.1.4

_______________________________________________
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