]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: ni_mio_common: fix interrupt handler for dev->read_subdev
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 21 Apr 2016 19:04:41 +0000 (12:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 05:19:49 +0000 (22:19 -0700)
commit923ff6feeb57235f1b9313064a122e884bc8e7c0
treeaeee66da37957f9ef8e12d74ce0f33d294925ac8
parent8ca48d52c1f97f13e4b26d99aa9eefae476721d7
staging: comedi: ni_mio_common: fix interrupt handler for dev->read_subdev

There may not be a dev->read_subdev, i.e. an analog input subdevice, that
supports async commands. If it doesn't exist the interrupt/dma will never
be enabled.  Fix ni_E_interrupt() so that the analog input subdevice is
only handled if it exists.

This also fixes minor NULL dereference issue in handle_a_interrupt().
If the dev->read_subdev is NULL the comedi_async pointer (s->async) will
not be allocated by the device postconfig so there is no way to get a
valid comedi_cmd (&s->async->cmd).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_mio_common.c