All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dudley Du <dudl@cypress.com>
Cc: jmmahler@gmail.com, rydberg@euromail.se, bleung@google.com,
	dan.carpenter@oracle.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] input: cyapa: fix variable dereferenced before check 'gen5_pip->resp_len' issue
Date: Thu, 22 Jan 2015 08:22:01 -0800	[thread overview]
Message-ID: <20150122162201.GC18153@dtor-ws> (raw)
In-Reply-To: <1421909406-1240-2-git-send-email-dudl@cypress.com>

On Thu, Jan 22, 2015 at 02:50:06PM +0800, Dudley Du wrote:
> Fixes the warning issue of the variable dereferenced before check
> 'gen5_pip->resp_len' report by dan Carpenter.
> 
> Signed-off-by: Dudley Du <dudl@cypress.com>

Applied, thank you.

> ---
>  drivers/input/mouse/cyapa_gen5.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/mouse/cyapa_gen5.c b/drivers/input/mouse/cyapa_gen5.c
> index 69d9059..ed1af74 100644
> --- a/drivers/input/mouse/cyapa_gen5.c
> +++ b/drivers/input/mouse/cyapa_gen5.c
> @@ -2558,7 +2558,9 @@ static bool cyapa_gen5_irq_cmd_handler(struct cyapa *cyapa)
>  			 * trackpad device when booting/rebooting
>  			 * their chrome book.
>  			 */
> -			length = *gen5_pip->resp_len;
> +			length = 0;
> +			if (gen5_pip->resp_len)
> +				length = *gen5_pip->resp_len;
>  			cyapa_empty_pip_output_data(cyapa,
>  					gen5_pip->resp_data,
>  					&length,
> -- 
> 1.9.1
> 

-- 
Dmitry

  reply	other threads:[~2015-01-22 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22  6:50 [PATCH 1/2] input: cyapa: fix sparse warning issue of incorrect type in assiggment Dudley Du
2015-01-22  6:50 ` [PATCH 2/2] input: cyapa: fix variable dereferenced before check 'gen5_pip->resp_len' issue Dudley Du
2015-01-22 16:22   ` Dmitry Torokhov [this message]
2015-01-22  9:31 ` [PATCH 1/2] input: cyapa: fix sparse warning issue of incorrect type in assiggment Jeremiah Mahler
2015-01-22  9:54   ` Dan Carpenter
2015-01-22  9:58     ` Dudley Du
2015-01-23  9:50     ` Jeremiah Mahler
2015-01-22  9:57   ` Dudley Du
2015-01-23  9:56     ` Jeremiah Mahler

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=20150122162201.GC18153@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=bleung@google.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dudl@cypress.com \
    --cc=jmmahler@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rydberg@euromail.se \
    /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.