]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
comedi: comedi_test: fix check for valid scan_begin_src in waveform_ai_cmdtest()
authorIan Abbott <abbotti@mev.co.uk>
Wed, 22 Apr 2026 16:21:19 +0000 (17:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 May 2026 08:34:04 +0000 (10:34 +0200)
Commit 783ddaebd397 ("staging: comedi: comedi_test: support
scan_begin_src == TRIG_FOLLOW") neglected to add a test that
`scan_begin_src` has only one bit set.  The allowed values are
`TRIG_FOLLOW` and `TRIG_TIMER`, but the code incorrectly also allows
`TRIG_FOLLOW | TRIG_TIMER`.  Add a call to
`comedi_check_trigger_is_unique()` to check that only one trigger source
bit is set.

Fixes: 783ddaebd397 ("staging: comedi: comedi_test: support scan_begin_src == TRIG_FOLLOW")
Cc: stable <stable@kernel.org>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://patch.msgid.link/20260422162138.36003-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/comedi/drivers/comedi_test.c

index 4050f66193e550c68c17df4c251b962a81f2e141..1f430ffc7bd9132d98448a7a3b8d71b0e70d9880 100644 (file)
@@ -274,6 +274,7 @@ static int waveform_ai_cmdtest(struct comedi_device *dev,
        /* Step 2a : make sure trigger sources are unique */
 
        err |= comedi_check_trigger_is_unique(cmd->convert_src);
+       err |= comedi_check_trigger_is_unique(cmd->scan_begin_src);
        err |= comedi_check_trigger_is_unique(cmd->stop_src);
 
        /* Step 2b : and mutually compatible */