summaryrefslogtreecommitdiffstats
path: root/lib/mpi
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-10-03 16:25:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 11:46:35 -0700
commitaaeb61a97b7159ebe30b18a422d04eeabfa8790b (patch)
treedfff551a12b9e612f29d342c5b284db29cf2d12f /lib/mpi
parentdfb2540e91e1f63765bc3ff497ad0b714d774261 (diff)
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>
Diffstat (limited to 'lib/mpi')
0 files changed, 0 insertions, 0 deletions