aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-02-19 19:33:39 -0500
committerJiri Kosina <jkosina@suse.cz>2007-03-01 03:52:40 -0500
commit4237081e573b99a48991aa71364b0682c444651c (patch)
tree5cf1dcafc22987ae5f426719559c9133988a55bf /drivers/hid
parentfdc9c566161c119febe4fab0f7c382416681fd8f (diff)
HID: fix bug in zeroing the last field byte in output reports
d4ae650a904612ffb7edd3f28b69b022988d2466 introduced zeroing of the last field byte in output reports in order to make sure the unused bits are set to 0. This is done in a wrong way, resulting in a wrong bits being zeroed out (not properly shifted by the field offset in the report). Fix this. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 7452399501b4..aeeb6798e2f1 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -880,7 +880,7 @@ static void hid_output_field(struct hid_field *field, __u8 *data)
880 880
881 /* make sure the unused bits in the last byte are zeros */ 881 /* make sure the unused bits in the last byte are zeros */
882 if (count > 0 && size > 0) 882 if (count > 0 && size > 0)
883 data[(count*size-1)/8] = 0; 883 data[(offset+count*size-1)/8] = 0;
884 884
885 for (n = 0; n < count; n++) { 885 for (n = 0; n < count; n++) {
886 if (field->logical_minimum < 0) /* signed values */ 886 if (field->logical_minimum < 0) /* signed values */