Skip to content

Commit

Permalink
staging: comedi: check data length for INSN_CONFIG_DIGITAL_TRIG
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Nov 15, 2012
1 parent 33cdce6 commit b0a2b6d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b0a2b6d

Please sign in to comment.