linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: dudl@cypress.com
Cc: linux-input@vger.kernel.org
Subject: re: Input: cyapa - add gen5 trackpad device basic functions support
Date: Wed, 21 Jan 2015 16:19:49 +0300	[thread overview]
Message-ID: <20150121131949.GA4622@mwanda> (raw)

Hello Dudley Du,

This is a semi-automatic email about new static checker warnings.

The patch 6972a859601a: "Input: cyapa - add gen5 trackpad device
basic functions support" from Jan 17, 2015, leads to the following
Smatch complaint:

drivers/input/mouse/cyapa_gen5.c:2564 cyapa_gen5_irq_cmd_handler()
	 warn: variable dereferenced before check 'gen5_pip->resp_len' (see line 2559)

drivers/input/mouse/cyapa_gen5.c
  2558				 */
  2559				length = *gen5_pip->resp_len;
                                         ^^^^^^^^^^^^^^^^^^^
Patch introduces a dereference.

  2560				cyapa_empty_pip_output_data(cyapa,
  2561						gen5_pip->resp_data,
  2562						&length,
  2563						gen5_pip->resp_sort_func);
  2564				if (gen5_pip->resp_len && length != 0) {
                                    ^^^^^^^^^^^^^^^^^^
Patch introduces a check.

  2565					*gen5_pip->resp_len = length;
  2566					atomic_dec(&gen5_pip->cmd_issued);

regards,
dan carpenter

             reply	other threads:[~2015-01-21 13:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 13:19 Dan Carpenter [this message]
2015-01-22  1:50 ` Input: cyapa - add gen5 trackpad device basic functions support Dudley Du
2015-01-22  8:31   ` Dan Carpenter
2015-01-22  8:44     ` Dudley Du

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=20150121131949.GA4622@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dudl@cypress.com \
    --cc=linux-input@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).