Xin Zhao ea427a222d HID: core: Fix deadloop in hid_apply_multiplier.
The initial value of hid->collection[].parent_idx if 0. When
Report descriptor doesn't contain "HID Collection", the value
remains as 0.

In the meanwhile, when the Report descriptor fullfill
all following conditions, it will trigger hid_apply_multiplier
function call.
1. Usage page is Generic Desktop Ctrls (0x01)
2. Usage is RESOLUTION_MULTIPLIER (0x48)
3. Contain any FEATURE items

The while loop in hid_apply_multiplier will search the top-most
collection by searching parent_idx == -1. Because all parent_idx
is 0. The loop will run forever.

There is a Report Descriptor triggerring the deadloop
0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x48,        // Usage (0x48)
0x95, 0x01,        // Report Count (1)
0x75, 0x08,        // Report Size (8)
0xB1, 0x01,        // Feature

Signed-off-by: Xin Zhao <xnzhao@google.com>
Link: https://lore.kernel.org/r/20230130212947.1315941-1-xnzhao@google.com
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2023-02-06 10:57:27 +01:00
..
2022-12-13 10:54:19 -08:00
2022-12-13 12:44:40 -08:00
2022-10-12 10:23:24 -07:00
2022-12-13 10:43:59 -08:00
2022-12-13 11:59:58 -08:00
2022-12-12 16:39:38 -08:00
2022-12-08 13:03:47 -08:00
2022-12-13 11:59:58 -08:00
2022-12-13 12:54:31 -08:00
2022-12-13 11:59:58 -08:00
2022-12-12 13:38:17 -08:00
2022-12-13 13:09:38 -08:00
2022-12-13 11:27:26 -08:00
2022-12-13 13:20:36 -08:00
2022-12-13 11:59:58 -08:00
2022-12-13 13:20:36 -08:00
2022-12-13 09:05:19 -08:00
2022-12-07 17:50:44 +01:00
2022-10-09 14:05:15 -07:00
2022-12-12 13:38:17 -08:00
2022-12-13 11:59:58 -08:00
2022-12-13 11:59:58 -08:00
2022-12-13 11:59:58 -08:00
2022-12-13 12:32:07 -08:00
2022-12-13 09:05:19 -08:00
2022-12-13 10:43:59 -08:00
2022-12-12 10:17:08 -08:00
2022-12-13 13:13:55 -08:00
2022-12-13 10:43:59 -08:00
2022-12-12 15:19:38 -08:00
2022-12-13 11:36:58 -08:00
2022-12-13 12:49:59 -08:00
2022-12-13 12:49:59 -08:00
2022-12-13 09:05:19 -08:00
2022-12-13 10:54:19 -08:00
2022-12-13 12:54:31 -08:00
2022-12-13 11:59:58 -08:00
2022-12-12 10:17:08 -08:00
2022-12-12 09:01:36 -08:00
2022-12-13 10:43:59 -08:00
2022-10-10 14:02:53 -07:00
2022-12-13 11:59:58 -08:00
2022-12-13 11:59:58 -08:00