diff options
| author | Ingo Molnar <mingo@kernel.org> | 2019-11-11 07:59:06 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2019-11-11 07:59:06 +0100 |
| commit | 1ca7feb59087a3d1a4ef79e09c42eca5c2e7fa38 (patch) | |
| tree | 548d3518b41341b93c88ee4ff5661e1eb42bd7f4 /drivers/hid/hid-core.c | |
| parent | d44f821b0e13275735e8f3fe4db8703b45f05d52 (diff) | |
| parent | 31f4f5b495a62c9a8b15b1c3581acd5efeb9af8c (diff) | |
| download | linux-next-1ca7feb59087a3d1a4ef79e09c42eca5c2e7fa38.tar.gz linux-next-1ca7feb59087a3d1a4ef79e09c42eca5c2e7fa38.zip | |
Merge tag 'v5.4-rc7' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/hid/hid-core.c')
| -rw-r--r-- | drivers/hid/hid-core.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 3eaee2c37931..63fdbf09b044 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1139,6 +1139,7 @@ int hid_open_report(struct hid_device *device) __u8 *start; __u8 *buf; __u8 *end; + __u8 *next; int ret; static int (*dispatch_type[])(struct hid_parser *parser, struct hid_item *item) = { @@ -1192,7 +1193,8 @@ int hid_open_report(struct hid_device *device) device->collection_size = HID_DEFAULT_NUM_COLLECTIONS; ret = -EINVAL; - while ((start = fetch_item(start, end, &item)) != NULL) { + while ((next = fetch_item(start, end, &item)) != NULL) { + start = next; if (item.format != HID_ITEM_FORMAT_SHORT) { hid_err(device, "unexpected long global item\n"); @@ -1230,7 +1232,8 @@ int hid_open_report(struct hid_device *device) } } - hid_err(device, "item fetching failed at offset %d\n", (int)(end - start)); + hid_err(device, "item fetching failed at offset %u/%u\n", + size - (unsigned int)(end - start), size); err: kfree(parser->collection_stack); alloc_err: |
