summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorSumit Semwal <sumit.semwal@linaro.org>2017-11-03 09:28:46 +0530
committerSumit Semwal <sumit.semwal@linaro.org>2017-11-03 09:28:46 +0530
commitb32bfe2e8d2cc1e5a6da9a5573d496ae7df8f23f (patch)
tree0a4161366523ff8be6418196a71883fc58cd3234 /drivers/input
parentc9653f0531d8d32836aa4c8d75ce10a82a4d7492 (diff)
parent27e68f1bca91a7f69808c8641f03c66cca2bb365 (diff)
Merge remote-tracking branch 'stable/linux-4.4.y' into lts-4.4.y-hikey4.4.96-hikey
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/elan_i2c_core.c1
-rw-r--r--drivers/input/tablet/gtco.c17
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 681dce15fbc8..b8c50d883b2c 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -1240,6 +1240,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
{ "ELAN0605", 0 },
{ "ELAN0609", 0 },
{ "ELAN060B", 0 },
+ { "ELAN0611", 0 },
{ "ELAN1000", 0 },
{ }
};
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 7c18249d6c8e..8b68a210277b 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -231,13 +231,17 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
/* Walk this report and pull out the info we need */
while (i < length) {
- prefix = report[i];
-
- /* Skip over prefix */
- i++;
+ prefix = report[i++];
/* Determine data size and save the data in the proper variable */
- size = PREF_SIZE(prefix);
+ size = (1U << PREF_SIZE(prefix)) >> 1;
+ if (i + size > length) {
+ dev_err(ddev,
+ "Not enough data (need %d, have %d)\n",
+ i + size, length);
+ break;
+ }
+
switch (size) {
case 1:
data = report[i];
@@ -245,8 +249,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
case 2:
data16 = get_unaligned_le16(&report[i]);
break;
- case 3:
- size = 4;
+ case 4:
data32 = get_unaligned_le32(&report[i]);
break;
}