From: Andrew Duggan <aduggan@synaptics.com>
To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andrew Duggan <aduggan@synaptics.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Vincent Huang <vincent.huang@tw.synaptics.com>,
Nick Dyer <nick@shmanahar.org>, Chris Healy <cphealy@gmail.com>,
Nitin Chaudhary <nitinchaudhary1289@gmail.com>,
stable@vger.kernel.org
Subject: [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8
Date: Tue, 19 Jul 2016 16:43:41 -0700 [thread overview]
Message-ID: <1468971821-16982-1-git-send-email-aduggan@synaptics.com> (raw)
According to the RMI4 spec the maximum size of F12 control register 8 is
15 bytes. The current code incorrectly reports an error if control 8 is
greater then 14. Making sensors with a control register 8 with 15 bytes
unusable.
Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Reported-by: Chris Healy <cphealy@gmail.com>
Cc: stable@vger.kernel.org
---
drivers/input/rmi4/rmi_f12.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
index c30fd86..9b0d9f7 100644
--- a/drivers/input/rmi4/rmi_f12.c
+++ b/drivers/input/rmi4/rmi_f12.c
@@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
struct rmi_device *rmi_dev = fn->rmi_dev;
int ret;
int offset;
- u8 buf[14];
+ u8 buf[15];
int pitch_x = 0;
int pitch_y = 0;
int clip_x_low = 0;
@@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8);
- if (item->reg_size > 14) {
- dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n",
+ if (item->reg_size > 15) {
+ dev_err(&fn->dev,
+ "F12 control8 should be a maximum of 15 bytes, not: %ld\n",
item->reg_size);
return -ENODEV;
}
--
2.7.4
next reply other threads:[~2016-07-19 23:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-19 23:43 Andrew Duggan [this message]
2016-07-20 0:00 ` [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8 Dmitry Torokhov
2016-07-20 0:02 ` Andrew Duggan
2016-07-20 1:16 ` Nitin Chaudhary
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=1468971821-16982-1-git-send-email-aduggan@synaptics.com \
--to=aduggan@synaptics.com \
--cc=benjamin.tissoires@redhat.com \
--cc=cphealy@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@shmanahar.org \
--cc=nitinchaudhary1289@gmail.com \
--cc=stable@vger.kernel.org \
--cc=vincent.huang@tw.synaptics.com \
/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).