diff options
| author | Chase Southwood <chase.southwood@yahoo.com> | 2014-02-13 19:02:26 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-14 09:18:39 -0800 |
| commit | b0377d4bd438d00310005190a46920cb0279106f (patch) | |
| tree | 672b2a8038ba8ddbed60b9f8368f2ab41b0f53c5 /include/linux/root_dev.h | |
| parent | 6bc2b856bb7c49f238914d965c0b1057ec78226e (diff) | |
Staging: comedi: clean up conditional statement in addi_apci_3xxx.c
In this conditional statement, if (chan < 16), but the instruction passed
in data[0] is INSN_CONFIG_DIO_QUERY, the function does not return early,
but the else-branch does not get executed either. As a result, mask
would be used uninitialized in the next line. We want
comedi_dio_insn_config() to use a chan_mask based on the chanspec for the
INSN_CONFIG_DIO_QUERY instruction, so mask should be initialized to 0.
Then, if instead the instruction is INSN_CONFIG_DIO_{INPUT,OUTPUT}, we
return an error if (chan < 16) as these are invalid instructions for
ports 0 and 1, or update the mask otherwise, so all the io_bits are
modified for port 2. This ensures that mask is always initialized by the
time it is used.
Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/root_dev.h')
0 files changed, 0 insertions, 0 deletions
