svn commit: r235866 - in stable/9: lib/libusbhid sys/dev/usb

Alexander Motin mav at FreeBSD.org
Thu May 24 01:23:30 UTC 2012


Author: mav
Date: Thu May 24 01:23:30 2012
New Revision: 235866
URL: http://svn.freebsd.org/changeset/base/235866

Log:
  MFC r235510:
  HID Report ID is unsigned value, so clear the rest of bits from possible
  sign expansion.

Modified:
  stable/9/lib/libusbhid/parse.c
  stable/9/sys/dev/usb/usb_hid.c
Directory Properties:
  stable/9/lib/libusbhid/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/lib/libusbhid/parse.c
==============================================================================
--- stable/9/lib/libusbhid/parse.c	Wed May 23 23:43:55 2012	(r235865)
+++ stable/9/lib/libusbhid/parse.c	Thu May 24 01:23:30 2012	(r235866)
@@ -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 */

Modified: stable/9/sys/dev/usb/usb_hid.c
==============================================================================
--- stable/9/sys/dev/usb/usb_hid.c	Wed May 23 23:43:55 2012	(r235865)
+++ stable/9/sys/dev/usb/usb_hid.c	Thu May 24 01:23:30 2012	(r235866)
@@ -425,7 +425,7 @@ hid_get_item(struct hid_data *s, struct 
 				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 */


More information about the svn-src-stable-9 mailing list