linux/drivers/staging/comedi
Chase Southwood b0377d4bd4 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>
2014-02-14 09:18:39 -08:00
..
drivers Staging: comedi: clean up conditional statement in addi_apci_3xxx.c 2014-02-14 09:18:39 -08:00
kcomedilib staging: comedi: remove comedi_debug module parameter 2013-11-25 11:50:53 -08:00
comedi_buf.c staging: comedi: protect buffer from being freed while mmapped 2013-11-11 16:16:45 -08:00
comedi_compat32.c file->f_op is never NULL... 2013-10-24 23:34:54 -04:00
comedi_compat32.h
comedi_fops.c Staging: comedi: Correct a few printf format codes 2014-02-12 09:32:17 -08:00
comedi_internal.h staging: comedi: protect buffer from being freed while mmapped 2013-11-11 16:16:45 -08:00
comedi_pci.c
comedi_pcmcia.c
comedi_usb.c
comedi.h
comedidev.h comedi: Humusoft MF634 and MF624 DAQ cards driver 2014-01-13 15:03:12 -08:00
comedilib.h staging: comedi: comedi_bond: handle base channel for insn_bits 2013-08-26 06:41:56 -07:00
drivers.c staging: comedi: fix too early cleanup in comedi_auto_config() 2014-02-07 11:08:46 -08:00
Kconfig comedi: Humusoft MF634 and MF624 DAQ cards driver 2014-01-13 15:03:12 -08:00
Makefile staging: comedi: remove comedi_debug module parameter 2013-11-25 11:50:53 -08:00
proc.c staging: comedi: use refcount while reading /proc/comedi 2013-11-11 16:16:44 -08:00
range.c staging: comedi: range: remove use of DPRINTK 2013-11-25 11:50:53 -08:00
TODO MAINTAINERS: Update the list of maintainers for staging/comedi driver. 2013-07-24 09:51:18 -07:00