Commit 0e3b0666 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Greg Kroah-Hartman

HID: input: fix assignment of .value

commit 39b3c3a5 upstream.

The value field is actually an array of .maxfield. We should assign the
correct number to the correct usage.

Not that we never encounter a device that requires this ATM, but better
have the proper code path.

Fixes: 2dc702c9 ("HID: input: use the Resolution Multiplier for
       high-resolution scrolling")
Cc: stable@vger.kernel.org  # v5.0+
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 76f693f0
...@@ -1595,7 +1595,7 @@ static bool __hidinput_change_resolution_multipliers(struct hid_device *hid, ...@@ -1595,7 +1595,7 @@ static bool __hidinput_change_resolution_multipliers(struct hid_device *hid,
if (usage->hid != HID_GD_RESOLUTION_MULTIPLIER) if (usage->hid != HID_GD_RESOLUTION_MULTIPLIER)
continue; continue;
*report->field[i]->value = value; report->field[i]->value[j] = value;
update_needed = true; update_needed = true;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment