summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2012-05-16 17:51:56 +0000
committermav <mav@FreeBSD.org>2012-05-16 17:51:56 +0000
commit3135fa1ca0fbfec6b2f6dfc4fe0ebddf4b44c8b7 (patch)
tree9c23c98b74eb3979609cc1d2450f6bae78ada75c
parentb227d4379e3f747272635a63519b7b82bc3ddbf8 (diff)
downloadFreeBSD-src-3135fa1ca0fbfec6b2f6dfc4fe0ebddf4b44c8b7.zip
FreeBSD-src-3135fa1ca0fbfec6b2f6dfc4fe0ebddf4b44c8b7.tar.gz
HID Report ID is unsigned value, so clear the rest of bits from possible
sign expansion.
-rw-r--r--lib/libusbhid/parse.c2
-rw-r--r--sys/dev/usb/usb_hid.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libusbhid/parse.c b/lib/libusbhid/parse.c
index f7c2cb1..041e289 100644
--- a/lib/libusbhid/parse.c
+++ b/lib/libusbhid/parse.c
@@ -392,7 +392,7 @@ hid_get_item(hid_data_t s, hid_item_t *h)
s->loc_size = dval & mask;
break;
case 8:
- hid_switch_rid(s, c, dval);
+ hid_switch_rid(s, c, dval & mask);
break;
case 9:
/* mask because value is unsigned */
diff --git a/sys/dev/usb/usb_hid.c b/sys/dev/usb/usb_hid.c
index 165919b..6552546 100644
--- a/sys/dev/usb/usb_hid.c
+++ b/sys/dev/usb/usb_hid.c
@@ -425,7 +425,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
s->loc_size = dval & mask;
break;
case 8:
- hid_switch_rid(s, c, dval);
+ hid_switch_rid(s, c, dval & mask);
break;
case 9:
/* mask because value is unsigned */
OpenPOWER on IntegriCloud