linux/drivers/staging
Ian Abbott aaeb61a97b staging: comedi: amplc_pc236: fix invalid register access during detach
`pc236_detach()` is called by the comedi core if it attempted to attach
a device and failed.  `pc236_detach()` calls `pc236_intr_disable()` if
the comedi device private data pointer (`devpriv`) is non-null.  This
test is insufficient as `pc236_intr_disable()` accesses hardware
registers and the attach routine may have failed before it has saved
their I/O base addresses.

Fix it by checking `dev->iobase` is non-zero before calling
`pc236_intr_disable()` as that means the I/O base addresses have been
saved and the hardware registers can be accessed.  It also implies the
comedi device private data pointer is valid, so there is no need to
check it.

Cc: <stable@vger.kernel.org> # 3.5.x, 3.6.x
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:46:35 -07:00
..
android mm: kill vma flag VM_CAN_NONLINEAR 2012-10-09 16:22:17 +09:00
asus_oled
bcm
ccg Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
ced1401
comedi staging: comedi: amplc_pc236: fix invalid register access during detach 2012-10-22 11:46:35 -07:00
cptm1217
crystalhd
csr
cxt1e1
dgrp userns: Fix build of drivers/staging/dgrp 2012-10-03 09:52:08 -07:00
echo
et131x
frontier
ft1000
gdm72xx Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-10-02 13:38:27 -07:00
iio staging:iio:adis16400: Fixup adis16336 temp channel attributes 2012-10-19 16:23:34 +01:00
imx-drm
ipack
keucr
line6
media
net
nvec Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
octeon
olpc_dcon
omap-thermal Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux into thermal 2012-10-09 01:35:52 -04:00
omapdrm fbdev updates for 3.7 2012-10-12 10:21:02 +09:00
ozwpan
panel
phison
quickstart
ramster
rtl8187se
rtl8192e
rtl8192u
rtl8712
rts5139
rts_pstor
sbe-2t3e3
sep
serqt_usb2
silicom
slicoss
sm7xxfb
speakup
ste_rmi4
telephony
tidspbridge mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
usbip
vme
vt6655
vt6656
winbond Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-10-02 13:38:27 -07:00
wlags49_h2
wlags49_h25
wlan-ng
xgifb
zcache
zram
zsmalloc
Kconfig
Makefile
staging.c