]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - pending-5.1/hid-input-fix-assignment-of-.value.patch
Fix up backported ptrace patch
[thirdparty/kernel/stable-queue.git] / pending-5.1 / hid-input-fix-assignment-of-.value.patch
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
5
6 From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
7
8 commit 39b3c3a5fbc5d744114e497d35bf0c12f798c134 upstream.
9
10 The value field is actually an array of .maxfield. We should assign the
11 correct number to the correct usage.
12
13 Not that we never encounter a device that requires this ATM, but better
14 have the proper code path.
15
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>
21
22 ---
23 drivers/hid/hid-input.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
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)
30 continue;
31
32 - *report->field[i]->value = value;
33 + report->field[i]->value[j] = value;
34 update_needed = true;
35 }
36 }