From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ian Abbott <abbotti@mev.co.uk>
Cc: stable@vger.kernel.org, Ben Hutchings <ben@decadent.org.uk>,
H Hartley Sweeten <hsweeten@visionengravers.com>
Subject: Re: [PATCH stable 3.15 to 3.18] staging: comedi: dt282x: fix a null pointer deref on interrupt
Date: Fri, 2 Aug 2019 09:45:57 +0200 [thread overview]
Message-ID: <20190802074557.GF26174@kroah.com> (raw)
In-Reply-To: <20190712140237.15847-1-abbotti@mev.co.uk>
On Fri, Jul 12, 2019 at 03:02:37PM +0100, Ian Abbott wrote:
> 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:
>
> cfc_handle_events(dev, s_ao);
>
> [ Upstream equivalent:
> comedi_handle_events(dev, s_ao);
> -- IA ]
>
> 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.)
>
> Fixes: f21c74fa4cfe ("staging: comedi: dt282x: use cfc_handle_events()")
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/staging/comedi/drivers/dt282x.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Thanks for the patch, I've taken it for my 3.18-android tree.
greg k-h
next prev parent reply other threads:[~2019-08-02 7:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 14:02 [PATCH stable 3.15 to 3.18] staging: comedi: dt282x: fix a null pointer deref on interrupt Ian Abbott
2019-08-02 7:45 ` Greg Kroah-Hartman [this message]
2019-09-19 18:34 ` Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190802074557.GF26174@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=abbotti@mev.co.uk \
--cc=ben@decadent.org.uk \
--cc=hsweeten@visionengravers.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.