diff options
author | PixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com> | 2023-08-27 18:45:54 -0700 |
---|---|---|
committer | SecurityBot <android-nexus-securitybot@system.gserviceaccount.com> | 2023-08-27 18:45:54 -0700 |
commit | 35e4dbc8ca16b1af733636a94ce5633b1eb67962 (patch) | |
tree | 701812424e236ee57ba835a3625b7c1d56544f7b | |
parent | f9ec07886371a8e8054b6a9259166b0db9935a67 (diff) | |
parent | cd42479925864d70965c1e67829e566a9e1984e5 (diff) | |
download | fts_touch-35e4dbc8ca16b1af733636a94ce5633b1eb67962.tar.gz |
Merge android14-gs-pixel-5.15-udc-qpr1 into android14-gs-pixel-5.15
SBMerger: 558810260
Change-Id: Id2c4479b2498afa49fbc1b2f9cb5822de2c7f6c4
Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r-- | ftm5/fts.c | 5 | ||||
-rw-r--r-- | ftm5/fts_lib/ftsSoftware.h | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -4007,6 +4007,11 @@ static irqreturn_t fts_interrupt_handler(int irq, void *handle) for (count = 0; count < events_remaining + 1; count++) { evt_data = &data[count * FIFO_EVENT_SIZE]; + if (!VALID_EVENT_TYPE(evt_data[0])) { + dev_err(info->dev, "Got invalid event type: %*ph\n", 8, evt_data); + goto exit; + } + switch (GET_EVENT_TYPE(evt_data[0])) { case EVT_ID_CONTROLLER_READY: case EVT_ID_ERROR: diff --git a/ftm5/fts_lib/ftsSoftware.h b/ftm5/fts_lib/ftsSoftware.h index c5adb31..9f1c30c 100644 --- a/ftm5/fts_lib/ftsSoftware.h +++ b/ftm5/fts_lib/ftsSoftware.h @@ -375,6 +375,7 @@ enum { /** @}*/ /* bit2 and bit3 are for major data so skip it. */ #define GET_EVENT_TYPE(event_data) (event_data & 0xF3) +#define VALID_EVENT_TYPE(event_data) ((event_data & 0x03) == 0x03) /* EVENT ID */ /** @defgroup events_group FW Event IDs and Types * Event IDs and Types pushed by the FW into the FIFO |