diff options
author | Tai Kuo <taikuo@google.com> | 2021-07-22 11:42:04 +0800 |
---|---|---|
committer | Tai Kuo <taikuo@google.com> | 2021-07-22 12:08:23 +0800 |
commit | 07c50f7cbbaf6382f284d4d5e70b7e250e173b9e (patch) | |
tree | 66a3569da6e7c04ecb40c8cb715137cca1451447 | |
parent | c9e1b94ab830bd0b660d4473f9023014647f02d4 (diff) | |
download | fts_touch-07c50f7cbbaf6382f284d4d5e70b7e250e173b9e.tar.gz |
touch/ftm5: only handle touch events with valid touch IDsandroid-s-v2-beta-3_r0.6android-12.1.0_r0.6android-12.1.0_r0.22android-12.1.0_r0.16android-12.0.0_r0.9android-12.0.0_r0.8android-12.0.0_r0.42android-12.0.0_r0.36android-12.0.0_r0.26android-12.0.0_r0.17android-12.0.0_r0.16android-gs-raviole-5.10-s-v2-beta-3android-gs-raviole-5.10-android12Landroid-gs-raviole-5.10-android12-qpr1-dandroid-gs-raviole-5.10-android12-d1
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.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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); |