]> Git Repo - linux.git/commitdiff
HID: wacom: Skip processing of touches with negative slot values
authorJason Gerecke <[email protected]>
Mon, 19 Jul 2021 20:55:31 +0000 (13:55 -0700)
committerJiri Kosina <[email protected]>
Wed, 28 Jul 2021 09:43:48 +0000 (11:43 +0200)
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]>
drivers/hid/wacom_wac.c

index 496a000ef862c03ceab9e5c54b5905cce36886ed..81ba642adcb74cbc351b0cbd3f95256c26ffe74c 100644 (file)
@@ -2548,6 +2548,9 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac,
                int slot;
 
                slot = input_mt_get_slot_by_key(input, hid_data->id);
+               if (slot < 0)
+                       return;
+
                input_mt_slot(input, slot);
                input_mt_report_slot_state(input, MT_TOOL_FINGER, prox);
        }
This page took 0.068443 seconds and 4 git commands to generate.