linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Andrew Duggan <aduggan@synaptics.com>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: rmi4 - prevent null pointer dereference in f30
Date: Fri, 10 Mar 2017 10:23:36 -0800	[thread overview]
Message-ID: <20170310182336.GF21811@dtor-ws> (raw)
In-Reply-To: <20170310180552.8375-1-benjamin.tissoires@redhat.com>

On Fri, Mar 10, 2017 at 07:05:52PM +0100, Benjamin Tissoires wrote:
> If the platform data has f30_data.disable set, f30 in rmi_f30_config()
> might be null. Prevent a kernel oops by checking for non-null f30.
> 
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Applied, thank you.

> ---
>  drivers/input/rmi4/rmi_f30.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c
> index d8ff285..a0e4030 100644
> --- a/drivers/input/rmi4/rmi_f30.c
> +++ b/drivers/input/rmi4/rmi_f30.c
> @@ -170,6 +170,10 @@ static int rmi_f30_config(struct rmi_function *fn)
>  				rmi_get_platform_data(fn->rmi_dev);
>  	int error;
>  
> +	/* can happen if f30_data.disable is set */
> +	if (!f30)
> +		return 0;
> +
>  	if (pdata->f30_data.trackstick_buttons) {
>  		/* Try [re-]establish link to F03. */
>  		f30->f03 = rmi_find_function(fn->rmi_dev, 0x03);
> -- 
> 2.9.3
> 

-- 
Dmitry

      reply	other threads:[~2017-03-10 18:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 18:05 [PATCH] Input: rmi4 - prevent null pointer dereference in f30 Benjamin Tissoires
2017-03-10 18:23 ` Dmitry Torokhov [this message]

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=20170310182336.GF21811@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=aduggan@synaptics.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).