mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
HID: tmff: Use 64-bit arithmetic for force feedback scaling
The logical minimum and maximum values come from the HID report descriptor and cover the full signed 32-bit range. Subtracting them in an int can overflow before the force feedback value is scaled. The subsequent multiplication can overflow as well, producing an incorrect value despite the final range checks. Use 64-bit intermediates for both scaling helpers, as done by commit48d1677779("HID: pidff: Fix integer overflow in pidff_rescale") for the same arithmetic in the PID driver. This keeps the arithmetic defined for the complete descriptor range before the result is clamped. Fixes:dc76c91214("Input: use new FF interface in the HID force feedback drivers") Fixes:b27c9590ca("HID: add support for Thrustmaster FGT Force Feedback wheel") Signed-off-by: Linmao Li <lilinmao@kylinos.cn> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
69226cd6fa
commit
463f7cc26c
1 changed files with 5 additions and 4 deletions
Loading…
Add table
Add a link
Reference in a new issue