WSL2-Linux-Kernel/drivers/staging
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
..
android
bcm
ced1401
comedi
cptm1217
crystalhd
cxt1e1
dgap
dgnc
dgrp
et131x
frontier
ft1000
fwserial
gdm72xx
gdm724x
goldfish
gs_fpgaboot
iio
imx-drm
keucr
line6
lustre
media
mt29f_spinand
netlogic
nokia_h4p
nvec
octeon
octeon-usb
olpc_dcon
ozwpan
panel
phison
quickstart
rtl8188eu
rtl8192e
rtl8192u
rtl8712
rtl8723au
rtl8821ae
rts5139
rts5208
sbe-2t3e3
sep
serqt_usb2
silicom
slicoss
speakup
ste_rmi4
tidspbridge
unisys
usbip
vme
vt6655
vt6656
winbond
wlags49_h2
wlags49_h25
wlan-ng
xgifb
xillybus
Kconfig
Makefile
staging.c