From: H Hartley Sweeten Date: Thu, 23 May 2013 20:05:59 +0000 (-0700) Subject: staging: comedi: usbduxsigma: check for invalid 'ao_timer' in all cases X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dd64d1efdab83d0c702a27ee7893c5df492cfe1f;p=linux-beck.git staging: comedi: usbduxsigma: check for invalid 'ao_timer' in all cases 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 Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index ed5085a70807..aa0090c55f60 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 */