summaryrefslogtreecommitdiff
path: root/drivers/hid/wacom_wac.h
diff options
context:
space:
mode:
authorJason Gerecke <jason.gerecke@wacom.com>2023-06-08 14:38:28 -0700
committerBenjamin Tissoires <bentiss@kernel.org>2023-06-26 16:09:28 +0200
commit9a6c0e28e215535b2938c61ded54603b4e5814c5 (patch)
treec64340fadca7b38d39e11a5b69411164ba464b53 /drivers/hid/wacom_wac.h
parent4c2216728f688da3c4478fec23be9bd820824664 (diff)
HID: wacom: Use ktime_t rather than int when dealing with timestamps
Code which interacts with timestamps needs to use the ktime_t type returned by functions like ktime_get. The int type does not offer enough space to store these values, and attempting to use it is a recipe for problems. In this particular case, overflows would occur when calculating/storing timestamps leading to incorrect values being reported to userspace. In some cases these bad timestamps cause input handling in userspace to appear hung. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/901 Fixes: 17d793f3ed53 ("HID: wacom: insert timestamp to packed Bluetooth (BT) events") CC: stable@vger.kernel.org Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20230608213828.2108-1-jason.gerecke@wacom.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Diffstat (limited to 'drivers/hid/wacom_wac.h')
-rw-r--r--drivers/hid/wacom_wac.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h
index 1a40bb8c5810..ee21bb260f22 100644
--- a/drivers/hid/wacom_wac.h
+++ b/drivers/hid/wacom_wac.h
@@ -324,7 +324,7 @@ struct hid_data {
int ps_connected;
bool pad_input_event_flag;
unsigned short sequence_number;
- int time_delayed;
+ ktime_t time_delayed;
};
struct wacom_remote_data {