mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
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>
This commit is contained in:
parent
ac26fca3e1
commit
efc7ce18d9
1 changed files with 2 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 1999 Andreas Gal
|
* Copyright (c) 1999 Andreas Gal
|
||||||
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
|
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
|
||||||
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
|
* 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;
|
unsigned int size;
|
||||||
|
|
||||||
list_for_each_entry(report, &hid->report_enum[type].report_list, list) {
|
list_for_each_entry(report, &hid->report_enum[type].report_list, list) {
|
||||||
size = ((report->size - 1) >> 3) + 1;
|
size = ((report->size - 1) >> 3) + 1 + hid->report_enum[type].numbered;
|
||||||
if (type == HID_INPUT_REPORT && hid->report_enum[type].numbered)
|
|
||||||
size++;
|
|
||||||
if (*max < size)
|
if (*max < size)
|
||||||
*max = size;
|
*max = size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue