1 From 39b3c3a5fbc5d744114e497d35bf0c12f798c134 Mon Sep 17 00:00:00 2001
2 From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
3 Date: Thu, 18 Apr 2019 09:47:41 +0200
4 Subject: HID: input: fix assignment of .value
6 From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
8 commit 39b3c3a5fbc5d744114e497d35bf0c12f798c134 upstream.
10 The value field is actually an array of .maxfield. We should assign the
11 correct number to the correct usage.
13 Not that we never encounter a device that requires this ATM, but better
14 have the proper code path.
16 Fixes: 2dc702c991e377 ("HID: input: use the Resolution Multiplier for
17 high-resolution scrolling")
18 Cc: stable@vger.kernel.org # v5.0+
19 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 drivers/hid/hid-input.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
26 --- a/drivers/hid/hid-input.c
27 +++ b/drivers/hid/hid-input.c
28 @@ -1595,7 +1595,7 @@ static bool __hidinput_change_resolution
29 if (usage->hid != HID_GD_RESOLUTION_MULTIPLIER)
32 - *report->field[i]->value = value;
33 + report->field[i]->value[j] = value;