linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: Add Microchip AR1021 i2c touchscreen
Date: Wed, 8 Oct 2014 10:56:49 -0700	[thread overview]
Message-ID: <20141008175649.GB14423@dtor-ws> (raw)
In-Reply-To: <1412779518-16712-1-git-send-email-christian.gmeiner@gmail.com>

Hi Christian,

On Wed, Oct 08, 2014 at 04:45:18PM +0200, Christian Gmeiner wrote:
> +static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
> +{
> +	struct ar1021_i2c *ar1021 = dev_id;
> +	struct input_dev *input = ar1021->input;
> +	u8 *data = ar1021->data;
> +	unsigned int x, y, button;
> +	int error;
> +
> +	error = i2c_master_recv(ar1021->client,
> +				ar1021->data, sizeof(ar1021->data));
> +	if (error < 0)

I think this check should be "if (retval != sizeof(ar1021->data))" to
avoid using garbage data in case of short read. I'll change it locally
and apply the patch.

-- 
Dmitry

  reply	other threads:[~2014-10-08 17:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 14:45 [PATCH] Input: Add Microchip AR1021 i2c touchscreen Christian Gmeiner
2014-10-08 17:56 ` Dmitry Torokhov [this message]
2014-10-09  7:39   ` Christian Gmeiner

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=20141008175649.GB14423@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=christian.gmeiner@gmail.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).