From: H Hartley Sweeten Date: Tue, 9 Sep 2014 23:16:04 +0000 (-0700) Subject: staging: comedi: s626: fix cmd->stop_arg validation for stop_src == TRIG_COUNT X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=32f9ff7039eb59eaef0c153328601ac6164b746a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git staging: comedi: s626: fix cmd->stop_arg validation for stop_src == TRIG_COUNT The only limit for the stop_arg with a stop_src == TRIG_COUNT is that there is at least 1 scan in order to prevent an empty acquisition. The max test is bogus. Fix the validation. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index a474670b6693..0e7621e890c3 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -2208,7 +2208,7 @@ static int s626_ai_cmdtest(struct comedi_device *dev, err |= cfc_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len); if (cmd->stop_src == TRIG_COUNT) - err |= cfc_check_trigger_arg_max(&cmd->stop_arg, 0x00ffffff); + err |= cfc_check_trigger_arg_min(&cmd->stop_arg, 1); else /* TRIG_NONE */ err |= cfc_check_trigger_arg_is(&cmd->stop_arg, 0);