Commit e3b9ea9a authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: Check length of INSN_CONFIG_TIMER_1 instruction

The contents of the Comedi configuration instruction
`INSN_CONFIG_TIMER_1` instruction are not very well defined, but the one
driver that uses it (the "cb_pcidas64" driver for the PCI-DAS4020/12
card) assumes its `insn->n` is 5. Add a check in
`check_insn_config_length()` to verify that `insn->n` is correct for
this configuration instruction.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b33fc68c
...@@ -1209,6 +1209,7 @@ static int check_insn_config_length(struct comedi_insn *insn, ...@@ -1209,6 +1209,7 @@ static int check_insn_config_length(struct comedi_insn *insn,
break; break;
case INSN_CONFIG_PWM_OUTPUT: case INSN_CONFIG_PWM_OUTPUT:
case INSN_CONFIG_ANALOG_TRIG: case INSN_CONFIG_ANALOG_TRIG:
case INSN_CONFIG_TIMER_1:
if (insn->n == 5) if (insn->n == 5)
return 0; return 0;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment