• Ian Abbott's avatar
    staging: comedi: dt282x: fix a null pointer deref on interrupt · a1fcfe09
    Ian Abbott authored
    commit b8336be66dec06bef518030a0df9847122053ec5 upstream.
    
    The interrupt handler `dt282x_interrupt()` causes a null pointer
    dereference for those supported boards that have no analog output
    support.  For these boards, `dev->write_subdev` will be `NULL` and
    therefore the `s_ao` subdevice pointer variable will be `NULL`.  In that
    case, the following call near the end of the interrupt handler results
    in a null pointer dereference:
    
    	comedi_handle_events(dev, s_ao);
    
    Fix it by only calling the above function if `s_ao` is valid.
    
    (There are other uses of `s_ao` by the interrupt handler that may or may
    not be reached depending on values of hardware registers.  Trust that
    they are reliable for now.)
    
    Note:
    commit 4f6f009b ("staging: comedi: dt282x: use comedi_handle_events()")
    propagates an earlier error from
    commit f21c74fa ("staging: comedi: dt282x: use cfc_handle_events()").
    
    Fixes: 4f6f009b ("staging: comedi: dt282x: use comedi_handle_events()")
    Cc: <stable@vger.kernel.org> # v3.19+
    Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    a1fcfe09
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...