linux-sg2042/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 Staging:BCM:DDRInit.c:Renaming __FUNCTION__ 2013-08-30 11:49:04 -07:00
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 staging: crystalhd: Resolve sparse 'different base types' warnings. 2013-08-30 11:46:46 -07:00
cxt1e1 staging: cxt1e1: Remove #define SBE_INCLUDE_SYMBOLS 2013-08-12 15:20:25 -07:00
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 staging: et131x: Remove frame error TODO item 2013-08-21 10:02:28 -07:00
frontier staging: frontier: use better DEVICE_ATTR_ macros 2013-08-24 10:30:28 -07:00
ft1000
fwserial
gdm72xx staging: gdm72xx: potential use after free in send_qos_list() 2013-07-23 15:08:50 -07:00
gdm724x staging: gdm724x: Remove version.h header inclusion in netlink_k.c 2013-08-27 22:53:22 -07:00
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 staging: keucr: be explicit to the sysfs file permissions 2013-08-24 10:33:07 -07:00
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 [media] msi3101: Fix compilation on i386 2013-08-24 13:35:14 -03:00
netlogic
nvec staging: nvec: re-enable the clock on resume 2013-07-29 11:29:37 -07:00
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 Staging: olpc_dcon: Removed more completed TODO entries 2013-08-21 10:02:28 -07:00
ozwpan staging: ozwpan: Return error, if PD is not connected. 2013-08-28 15:18:40 -07:00
panel
phison
quickstart staging: quickstart: fix up sysfs file permissions 2013-08-24 10:34:53 -07:00
rtl8187se staging: Update e-mail address for Andrea Merello 2013-08-27 22:03:53 -07:00
rtl8188eu staging: r8188eu: Add new device ID 2013-09-26 16:44:45 -07:00
rtl8192e staging: Update e-mail address for Andrea Merello 2013-08-27 22:03:53 -07:00
rtl8192u Staging: rtl8192u: r819xU_cmdpkt: checking NULL value after doing dev_alloc_skb 2013-09-25 16:53:39 -07:00
rtl8712 staging: rtl8712: return MAC in standard form 2013-07-23 14:52:19 -07:00
rts5139
sb105x
sbe-2t3e3
sep
serqt_usb2
silicom Staging: silicom: Remove useless unneeded semicolons 2013-07-23 14:42:56 -07:00
slicoss
sm7xxfb
speakup
ste_rmi4
tidspbridge staging: tidspbridge: Fix typos in comments 2013-08-21 10:02:28 -07:00
usbip staging: usbip: use DEVICE_ATTR_RO/RW for sysfs attributes 2013-08-26 12:02:54 -07:00
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 Staging: winbond: mds_f: deleted extern function 2013-08-12 14:55:50 -07:00
wlags49_h2 staging: wlags49_h2: remove sysfs file 2013-08-24 10:24:40 -07:00
wlags49_h25 staging: wlags49_h2: remove sysfs file 2013-08-24 10:24:40 -07:00
wlan-ng
xgifb Staging: xgifb: Fixed a warning of Space before semicolon 2013-08-12 14:08:27 -07:00
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 staging: zsmalloc: access page->private by using page_private macro 2013-07-23 14:52:19 -07:00
Kconfig staging: dgap: adds driver to kernel build 2013-08-22 10:47:53 -07:00
Makefile staging: dgap: adds driver to kernel build 2013-08-22 10:47:53 -07:00
staging.c