linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: dusonlin@emc.com.tw, linux-input@vger.kernel.org
Subject: Re: Input: add driver for Elan I2C/SMbus touchpad
Date: Thu, 23 Oct 2014 15:02:30 -0700	[thread overview]
Message-ID: <20141023220230.GA9463@dtor-ws> (raw)
In-Reply-To: <20141023145813.GA20197@mwanda>

Hi Dan,

On Thu, Oct 23, 2014 at 05:58:13PM +0300, Dan Carpenter wrote:
> Hello Duson Lin,
> 
> The patch 29fbd64b0fd2: "Input: add driver for Elan I2C/SMbus
> touchpad" from Oct 3, 2014, leads to the following static checker
> warning:

Can you copy committer on such reports as well please?

> 
> 	drivers/input/mouse/elan_i2c_smbus.c:372 elan_smbus_prepare_fw_update()
> 	warn: sizeof(NUMBER)?
> 
> drivers/input/mouse/elan_i2c_smbus.c
>    365                  /*
>    366                   * Read back password to make sure we enabled flash
>    367                   * successfully.
>    368                   */
>    369                  len = i2c_smbus_read_block_data(client,
>    370                                                  ETP_SMBUS_IAP_PASSWORD_READ,
>    371                                                  val);
>    372                  if (len != sizeof(ETP_SMBUS_IAP_PASSWORD)) {
>                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> sizeof(int) is 4.
> val is a 3 byte array.
> If we read 4 bytes then we are writing beyond the end of the val[]
> array.

We should be checking sizeof(u16) here, I'll fix it up.

Thanks.

-- 
Dmitry

      reply	other threads:[~2014-10-23 22:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 14:58 Input: add driver for Elan I2C/SMbus touchpad Dan Carpenter
2014-10-23 22:02 ` 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=20141023220230.GA9463@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dusonlin@emc.com.tw \
    --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).