summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorIan Abbott2012-11-14 12:22:57 +0100
committerGreg Kroah-Hartman2012-11-15 01:25:08 +0100
commitb0a2b6d8ac9ce5d27c9086a196d8f44194561979 (patch)
treec895dda68bf35495ba4db13aca375132f321c6bb /drivers/staging/comedi/comedi_fops.c
parentstaging: comedi: addi_apci_1032: conform to new INSN_CONFIG_DIGITAL_TRIG (diff)
downloadkernel-qcow2-linux-b0a2b6d8ac9ce5d27c9086a196d8f44194561979.tar.gz
kernel-qcow2-linux-b0a2b6d8ac9ce5d27c9086a196d8f44194561979.tar.xz
kernel-qcow2-linux-b0a2b6d8ac9ce5d27c9086a196d8f44194561979.zip
staging: comedi: check data length for INSN_CONFIG_DIGITAL_TRIG
The newly defined format for the `INSN_CONFIG_DIGITAL_TRIG` configuration instruction expects 6 data values. Check the length in `check_insn_config_length()` before calling the comedi subdevice's `insn_config` handler. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index c2a32cf95a82..06906f6f7f49 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -880,6 +880,10 @@ static int check_insn_config_length(struct comedi_insn *insn,
if (insn->n == 5)
return 0;
break;
+ case INSN_CONFIG_DIGITAL_TRIG:
+ if (insn->n == 6)
+ return 0;
+ break;
/* by default we allow the insn since we don't have checks for
* all possible cases yet */
default: