summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTai Kuo <taikuo@google.com>2021-07-22 11:42:04 +0800
committerTai Kuo <taikuo@google.com>2021-07-22 12:08:23 +0800
commit07c50f7cbbaf6382f284d4d5e70b7e250e173b9e (patch)
tree66a3569da6e7c04ecb40c8cb715137cca1451447
parentc9e1b94ab830bd0b660d4473f9023014647f02d4 (diff)
downloadfts_touch-07c50f7cbbaf6382f284d4d5e70b7e250e173b9e.tar.gz
Bug: 193366807 Test: Single touch manipulation Test: Put 10 fingers on the screen and remove them 1 by 1. Test: Press with 11 fingers and check if any error logs. Signed-off-by: Tai Kuo <taikuo@google.com> Change-Id: I9363d64d0e5e275b4e0ad2cbbfab6731b46f507e
-rw-r--r--ftm5/fts.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/ftm5/fts.c b/ftm5/fts.c
index b70c57a..5126b37 100644
--- a/ftm5/fts.c
+++ b/ftm5/fts.c
@@ -2963,6 +2963,12 @@ static bool fts_enter_pointer_event_handler(struct fts_ts_info *info, unsigned
touchType = event[1] & 0x0F;
touchId = (event[1] & 0xF0) >> 4;
+ if (touchId >= TOUCH_ID_MAX) {
+ mutex_unlock(&info->input_report_mutex);
+ dev_err(info->dev, "%s : Invalid touch ID = %d ! No Report...\n",
+ __func__, touchId);
+ goto no_report;
+ }
x = (((int)event[3] & 0x0F) << 8) | (event[2]);
y = ((int)event[4] << 4) | ((event[3] & 0xF0) >> 4);
@@ -3112,6 +3118,12 @@ static bool fts_leave_pointer_event_handler(struct fts_ts_info *info, unsigned
touchType = event[1] & 0x0F;
touchId = (event[1] & 0xF0) >> 4;
+ if (touchId >= TOUCH_ID_MAX) {
+ mutex_unlock(&info->input_report_mutex);
+ dev_err(info->dev, "%s : Invalid touch ID = %d ! No Report...\n",
+ __func__, touchId);
+ return false;
+ }
switch (touchType) {
#ifdef STYLUS_MODE
@@ -4477,8 +4489,8 @@ static void fts_offload_report(void *handle,
#ifndef SKIP_PRESSURE
if ((int)report->coords[i].pressure <= 0) {
dev_err(info->dev,
- "%s: Pressure is %i, but pointer is not leaving.\n",
- __func__, (int)report->coords[i].pressure);
+ "%s: Pressure is %i, but pointer %d is not leaving.\n",
+ __func__, (int)report->coords[i].pressure, i);
}
input_report_abs(info->input_dev, ABS_MT_PRESSURE,
report->coords[i].pressure);