Revert "HID: cougar: fix slab-out-of-bounds Read in cougar_report_fixup"

This reverts commit ee2cecbb6d.
This commit is contained in:
Ksawlii 2024-11-24 00:23:39 +01:00
parent 0c220f8a78
commit 8e655e1dbc

View file

@ -106,7 +106,7 @@ static void cougar_fix_g6_mapping(void)
static __u8 *cougar_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
if (*rsize >= 117 && rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
if (rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
(rdesc[115] | rdesc[116] << 8) >= HID_MAX_USAGES) {
hid_info(hdev,
"usage count exceeds max: fixing up report descriptor\n");