summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-02-10 14:35:08 +0000
committerpatrick <patrick@openbsd.org>2020-02-10 14:35:08 +0000
commit8945acc287c32d5270939c2b49dfd9022ee4fdd4 (patch)
tree16f1983fa69db7f5cd48d7871d3e0993a9b0df50
parentFor compatibility with the man(1) implementations of the man-1.6 (diff)
downloadwireguard-openbsd-8945acc287c32d5270939c2b49dfd9022ee4fdd4.tar.xz
wireguard-openbsd-8945acc287c32d5270939c2b49dfd9022ee4fdd4.zip
When walking the HID descriptor, even though we filter for hid_input
we will get hid_collection and hid_endcollection items. Since hid_ endcollection apparently returns the usage of the previous item, it was possible that we "see" two items for the same usage. Make sure that we only accept hid_input items. Both hidms and hidkbd do some- thing similar, fixes the Pinebook Pro's trackpad. ok kettenis@
-rw-r--r--sys/dev/hid/hidmt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/hid/hidmt.c b/sys/dev/hid/hidmt.c
index 1a577360924..532da1b6627 100644
--- a/sys/dev/hid/hidmt.c
+++ b/sys/dev/hid/hidmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hidmt.c,v 1.10 2019/11/08 01:20:22 yasuoka Exp $ */
+/* $OpenBSD: hidmt.c,v 1.11 2020/02/10 14:35:08 patrick Exp $ */
/*
* HID multitouch driver for devices conforming to Windows Precision Touchpad
* standard
@@ -176,6 +176,8 @@ hidmt_setup(struct device *self, struct hidmt *mt, void *desc, int dlen)
if (h.report_ID != mt->sc_rep_input)
continue;
+ if (h.kind != hid_input)
+ continue;
switch (h.usage) {
/* contact level usages */