alistair23-linux/drivers/staging
Ian Abbott 677a315656 staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice
The `insn_bits` handler `ni_65xx_dio_insn_bits()` has a `for` loop that
currently writes (optionally) and reads back up to 5 "ports" consisting
of 8 channels each.  It reads up to 32 1-bit channels but can only read
and write a whole port at once - it needs to handle up to 5 ports as the
first channel it reads might not be aligned on a port boundary.  It
breaks out of the loop early if the next port it handles is beyond the
final port on the card.  It also breaks out early on the 5th port in the
loop if the first channel was aligned.  Unfortunately, it doesn't check
that the current port it is dealing with belongs to the comedi subdevice
the `insn_bits` handler is acting on.  That's a bug.

Redo the `for` loop to terminate after the final port belonging to the
subdevice, changing the loop variable in the process to simplify things
a bit.  The `for` loop could now try and handle more than 5 ports if the
subdevice has more than 40 channels, but the test `if (bitshift >= 32)`
ensures it will break out early after 4 or 5 ports (depending on whether
the first channel is aligned on a port boundary).  (`bitshift` will be
between -7 and 7 inclusive on the first iteration, increasing by 8 for
each subsequent operation.)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: <stable@vger.kernel.org> # 3.10.y 3.11.y 3.12.y
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:27:32 -07:00
..
android Merge git://git.kvack.org/~bcrl/aio-next 2013-09-13 10:55:58 -07:00
bcm
btmtk_usb
ced1401
comedi staging: comedi: ni_65xx: (bug fix) confine insn_bits to one subdevice 2013-10-03 14:27:32 -07:00
cptm1217
crystalhd
cxt1e1
dgap staging: dgap: fix overflows and format strings 2013-09-17 07:39:27 -07:00
dgnc staging: dgnc: fix potential format string flaw 2013-09-17 07:39:27 -07:00
dgrp TTY/Serial driver patches for 3.12-rc1 2013-09-03 11:38:36 -07:00
dwc2 staging: dwc2: make dwc2_core_params documentation more complete 2013-08-30 14:14:54 -07:00
echo
et131x
frontier
ft1000
fwserial
gdm72xx
gdm724x
goldfish
iio staging: iio: ade7854-spi: Fix return value 2013-09-18 19:43:33 +01:00
imx-drm staging: imx-drm: Fix probe failure 2013-09-25 16:53:40 -07:00
keucr
line6 staging: line6: add bounds check in snd_toneport_source_put() 2013-09-17 07:39:28 -07:00
lustre staging: lustre: Cocci spatch "noderef" 2013-09-25 16:53:38 -07:00
media
netlogic
nvec
octeon staging: octeon-ethernet: rgmii: enable interrupts that we can handle 2013-09-17 07:39:28 -07:00
octeon-usb staging: octeon-usb: Cocci spatch "noderef" 2013-09-25 16:53:39 -07:00
olpc_dcon
ozwpan
panel
phison
quickstart
rtl8187se
rtl8188eu staging: r8188eu: Add new device ID 2013-09-26 16:44:45 -07:00
rtl8192e
rtl8192u Staging: rtl8192u: r819xU_cmdpkt: checking NULL value after doing dev_alloc_skb 2013-09-25 16:53:39 -07:00
rtl8712
rts5139
sb105x
sbe-2t3e3
sep
serqt_usb2
silicom
slicoss
sm7xxfb
speakup
ste_rmi4
tidspbridge
usbip
vme
vt6655 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-09-05 14:54:29 -07:00
vt6656 staging: vt6656: [BUG] iwctl_siwencodeext return if device not open 2013-09-25 16:53:40 -07:00
winbond
wlags49_h2
wlags49_h25
wlan-ng
xgifb
xillybus staging: xillybus: fix format string usage 2013-09-17 07:39:27 -07:00
zram Revert "staging: zram: Add auto loading of module if user opens /dev/zram." 2013-09-17 07:39:28 -07:00
zsmalloc
Kconfig
Makefile
staging.c