linux/drivers/staging/comedi
H Hartley Sweeten 2704f807f9 staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data
In usbdux_ao_cmd(), the channels for the command are transfered from the
cmd->chanlist and stored in the private data 'ao_chanlist'. The channel
numbers are bit-shifted when stored so that they become the "command"
that is transfered to the device. The channel to command conversion
results in the 'ao_chanlist' having these values for the channels:

  channel 0 -> ao_chanlist = 0x00
  channel 1 -> ao_chanlist = 0x40
  channel 2 -> ao_chanlist = 0x80
  channel 3 -> ao_chanlist = 0xc0

The problem is, the usbduxsub_ao_isoc_irq() function uses the 'chan' value
from 'ao_chanlist' to access the 'ao_readback' array in the private data.
So instead of accessing the array as 0, 1, 2, 3, it accesses it as 0x00,
0x40, 0x80, 0xc0.

Fix this by storing the raw channel number in 'ao_chanlist' and doing the
bit-shift when creating the command.

Fixes: a998a3db53 "staging: comedi: usbdux: cleanup the private data 'outBuffer'"
Cc: stable <stable@vger.kernel.org> # 3.12
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Bernd Porr <mail@berndporr.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-23 16:20:15 -07:00
..
drivers staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data 2014-04-23 16:20:15 -07:00
kcomedilib Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint() 2014-02-15 12:42:41 -08:00
Kconfig staging: comedi: poc: remove obsolete driver 2014-03-20 01:57:01 +00:00
Makefile staging: comedi: remove comedi_debug module parameter 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
comedi.h staging: comedi: remove FSF address from boilerplate text 2013-05-13 17:34:22 -04:00
comedi_buf.c staging: comedi: fix circular locking dependency in comedi_mmap() 2014-04-16 11:41:45 -07:00
comedi_compat32.c file->f_op is never NULL... 2013-10-24 23:34:54 -04:00
comedi_compat32.h staging: comedi: remove FSF address from boilerplate text 2013-05-13 17:34:22 -04:00
comedi_fops.c staging: comedi: fix circular locking dependency in comedi_mmap() 2014-04-16 11:41:45 -07:00
comedi_internal.h staging: comedi: fix circular locking dependency in comedi_mmap() 2014-04-16 11:41:45 -07:00
comedi_pci.c staging: comedi: remove FSF address from boilerplate text 2013-05-13 17:34:22 -04:00
comedi_pcmcia.c staging: comedi: remove FSF address from boilerplate text 2013-05-13 17:34:22 -04:00
comedi_usb.c staging: comedi: introduce comedi_to_usb_dev() 2013-05-21 10:59:10 -07:00
comedidev.h Staging: comedi: Fix unnecessary space after function pointer 2014-02-27 08:38: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: introduce comedi_timeout() 2014-02-14 09:28:43 -08:00
proc.c Staging: comedi: proc: title block update 2014-03-19 04:41:04 +00:00
range.c Staging: comedi: range: remove unnecessary sanity check 2014-03-08 18:59:48 -08:00