HID items of width 32 (bits) or greater are incorrectly extracted due to
a masking bug in hid-core.c:extract(). This patch fixes it up by forcing
the mask to be 64 bits wide.


Signed-off-by: Adam Kropelin <[EMAIL PROTECTED]>

--- linux-2.6.11/drivers/usb/input/hid-core.c   Thu Mar  3 20:40:49 2005
+++ linux-2.6.11.adk/drivers/usb/input/hid-core.c       Sun Mar 13 14:00:47 2005
@@ -757,7 +757,7 @@
 static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
 {
        report += (offset >> 5) << 2; offset &= 31;
-       return (le64_to_cpu(get_unaligned((__le64*)report)) >> offset) & ((1 << 
n) - 1);
+       return (le64_to_cpu(get_unaligned((__le64*)report)) >> offset) & ((1ULL 
<< n) - 1);
 }
 
 static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, 
__u32 value)



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to