linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frodo Lai <frodo.lai@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: rogerq@ti.com, rydberg@bitmath.org, jg1.han@samsung.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Input: pixcir_i2c_ts - fix receive error
Date: Tue, 16 Jun 2015 13:03:04 -0700	[thread overview]
Message-ID: <1434484984-15418-1-git-send-email-frodo_lai@bcmcom.com> (raw)

The i2c_master_recv() uses readsize to receive data from i2c but
compares to size of rdbuf which is always 27. This would casue
problem when the max_fingers is not 5. Change the comparison value
to readsize instead.

Signed-off-by: Frodo Lai <frodo_lai@bcmcom.com>
---
 drivers/input/touchscreen/pixcir_i2c_ts.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index 2c21071..8f3e243 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -78,7 +78,7 @@ static void pixcir_ts_parse(struct pixcir_i2c_ts_data *tsdata,
 	}
 
 	ret = i2c_master_recv(tsdata->client, rdbuf, readsize);
-	if (ret != sizeof(rdbuf)) {
+	if (ret != readsize) {
 		dev_err(&tsdata->client->dev,
 			"%s: i2c_master_recv failed(), ret=%d\n",
 			__func__, ret);
-- 
1.7.9.5


             reply	other threads:[~2015-06-16 20:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 20:03 Frodo Lai [this message]
2015-06-16 22:07 ` [PATCH] Input: pixcir_i2c_ts - fix receive error Dmitry Torokhov

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=1434484984-15418-1-git-send-email-frodo_lai@bcmcom.com \
    --to=frodo.lai@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jg1.han@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rogerq@ti.com \
    --cc=rydberg@bitmath.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).