From: Benjamin Tissoires Date: Thu, 18 Apr 2019 07:47:41 +0000 (+0200) Subject: HID: input: fix assignment of .value X-Git-Tag: v5.4-rc1~1093^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39b3c3a5fbc5d744114e497d35bf0c12f798c134;p=platform%2Fkernel%2Flinux-rpi.git HID: input: fix assignment of .value 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 --- diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index fadf76f..6dd0294 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1580,7 +1580,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; } }