lkml.org 
[lkml]   [2005]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.6.12-mm2
I'd like to lobby for the merging into mainline of this patch from
git-input. It fixes a real bug, seen by real users, and has been
languishing in the input tree since March. It may also be a candidate
for the stable tree given it's one-linedness.

--

Fix extraction of HID items >= 32 bits

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 <akropel1@rochester.rr.com>


--- 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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-06-26 16:04    [W:0.094 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site