alistair23-linux/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 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
bcm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
ced1401
comedi staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data 2014-04-23 16:20:15 -07:00
cptm1217
crystalhd
cxt1e1
dgap
dgnc
dgrp
et131x
frontier Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
ft1000
fwserial
gdm72xx
gdm724x
goldfish staging: goldfish: Call free_irq in error path 2014-04-16 11:41:44 -07:00
gs_fpgaboot staging: gs_fpgaboot: remove __TIMESTAMP__ macro 2014-04-15 14:46:43 -07:00
iio First found of IIO fixes for the 3.15 cycle. 2014-04-22 21:29:20 -07:00
imx-drm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-04-08 09:52:16 -07:00
keucr
line6
lustre Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-04-12 17:31:22 -07:00
media [media] msi3101: check I/O return values on stop streaming 2014-04-06 11:08:19 -03:00
mt29f_spinand
netlogic
nokia_h4p
nvec
octeon Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
octeon-usb
olpc_dcon
ozwpan
panel
phison
quickstart
rtl8188eu staging: r8188eu: Fix case where ethtype was never obtained and always be checked against 0 2014-04-16 13:07:19 -07:00
rtl8192e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
rtl8192u Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
rtl8712 staging: r8712u: Fix case where ethtype was never obtained and always be checked against 0 2014-04-16 13:07:19 -07:00
rtl8723au staging: r8723au: Add missing initialization of change_inx in sort algorithm 2014-04-16 11:41:45 -07:00
rtl8821ae staging/rtl8821ae: Fix OOM handling in _rtl_init_deferred_work() 2014-04-15 11:39:09 -07:00
rts5139
rts5208
sbe-2t3e3
sep
serqt_usb2
silicom
slicoss
speakup staging: speakup: fix misuse of kstrtol() in handle_goto() 2014-04-16 11:41:44 -07:00
ste_rmi4
tidspbridge
unisys Staging: unisys: use after free in list_for_each() 2014-04-16 11:41:45 -07:00
usbip staging/usbip: fix store_attach() sscanf return value check 2014-04-15 14:43:01 -07:00
vme staging: vme: fix memory leak in vme_user_probe() 2014-04-15 14:46:43 -07:00
vt6655
vt6656
winbond
wlags49_h2 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
wlags49_h25
wlan-ng
xgifb video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
xillybus
Kconfig staging: delete rtl8187se wireless driver 2014-04-16 11:35:54 -07:00
Makefile staging: delete rtl8187se wireless driver 2014-04-16 11:35:54 -07:00
staging.c