HID: Increase maximum report size allowed by hid_field_extract()

Commit 71f6fa90a3 ("HID: increase maximum global item tag report size
to 256") increases the max report size from 128 to 256.

We also need to update the report size in hid_field_extract() otherwise
it complains and truncates now valid report size:
[ 406.165461] hid-sensor-hub 001F:8086:22D8.0002: hid_field_extract() called with n (192) > 32! (kworker/5:1)

BugLink: https://bugs.launchpad.net/bugs/1818547
Fixes: 71f6fa90a3 ("HID: increase maximum global item tag report size to 256")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Kai-Heng Feng 2019-03-08 13:11:17 +08:00 committed by Jiri Kosina
parent 6b538cc213
commit 94a9992f7d

View File

@ -1301,10 +1301,10 @@ static u32 __extract(u8 *report, unsigned offset, int n)
u32 hid_field_extract(const struct hid_device *hid, u8 *report, u32 hid_field_extract(const struct hid_device *hid, u8 *report,
unsigned offset, unsigned n) unsigned offset, unsigned n)
{ {
if (n > 32) { if (n > 256) {
hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n",
n, current->comm); n, current->comm);
n = 32; n = 256;
} }
return __extract(report, offset, n); return __extract(report, offset, n);