]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
HID: input: fix assignment of .value
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Thu, 18 Apr 2019 07:47:41 +0000 (09:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2019 05:59:59 +0000 (07:59 +0200)
commit 39b3c3a5fbc5d744114e497d35bf0c12f798c134 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: 2dc702c991e377 ("HID: input: use the Resolution Multiplier for
       high-resolution scrolling")
Cc: stable@vger.kernel.org # v5.0+
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-input.c

index 11ff4d08b3d6b8f10e71b234aed43e66f15621a1..46c6efea1404ee664eb2e44837e09c67553fc5c3 100644 (file)
@@ -1595,7 +1595,7 @@ static bool __hidinput_change_resolution_multipliers(struct hid_device *hid,
                        if (usage->hid != HID_GD_RESOLUTION_MULTIPLIER)
                                continue;
 
-                       *report->field[i]->value = value;
+                       report->field[i]->value[j] = value;
                        update_needed = true;
                }
        }