summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2008-10-17 15:01:15 +0200
committerJiri Kosina <jkosina@suse.cz>2009-01-04 01:00:50 +0100
commitefc7ce18d9037aa947c1aad5eb712ecc47520126 (patch)
tree71e3874fee5c9018eb2a1f838a444a7877ba5ea8 /drivers/hid
parentac26fca3e14c8882e382daa7e96ab73e0186cf03 (diff)
downloadblackbird-op-linux-efc7ce18d9037aa947c1aad5eb712ecc47520126.tar.gz
blackbird-op-linux-efc7ce18d9037aa947c1aad5eb712ecc47520126.zip
HID: non-input reports can also be numbered
When computing the maximal buffer size needed, we must take into account that not only input reports can be numbered. Pointed out in bugzilla #10467 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/usbhid/hid-core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 606369ea24ca..2afc8617f591 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -4,7 +4,7 @@
* Copyright (c) 1999 Andreas Gal
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
- * Copyright (c) 2006-2007 Jiri Kosina
+ * Copyright (c) 2006-2008 Jiri Kosina
*/
/*
@@ -641,9 +641,7 @@ static void hid_find_max_report(struct hid_device *hid, unsigned int type,
unsigned int size;
list_for_each_entry(report, &hid->report_enum[type].report_list, list) {
- size = ((report->size - 1) >> 3) + 1;
- if (type == HID_INPUT_REPORT && hid->report_enum[type].numbered)
- size++;
+ size = ((report->size - 1) >> 3) + 1 + hid->report_enum[type].numbered;
if (*max < size)
*max = size;
}
OpenPOWER on IntegriCloud