Skip to content

Commit 7cc8524

Browse files
jigpuJiri Kosina
authored andcommitted
HID: wacom: Skip processing of touches with negative slot values
The `input_mt_get_slot_by_key` function may return a negative value if an error occurs (e.g. running out of slots). If this occurs we should really avoid reporting any data for the slot. Signed-off-by: Ping Cheng <[email protected]> Signed-off-by: Jason Gerecke <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 6ca2350 commit 7cc8524

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/hid/wacom_wac.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,6 +2548,9 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac,
25482548
int slot;
25492549

25502550
slot = input_mt_get_slot_by_key(input, hid_data->id);
2551+
if (slot < 0)
2552+
return;
2553+
25512554
input_mt_slot(input, slot);
25522555
input_mt_report_slot_state(input, MT_TOOL_FINGER, prox);
25532556
}

0 commit comments

Comments
 (0)