mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
HID: pidff: Clamp effect playback LOOP_COUNT value
Ensures the loop count will never exceed the logical_maximum. Fixes implementation errors happening when applications use the max value of int32/DWORD as the effect iterations. This could be observed when running software both native and in wine. Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
bbeface105
commit
0c6673e3d1
|
|
@ -690,7 +690,8 @@ static void pidff_playback_pid(struct pidff_device *pidff, int pid_id, int n)
|
|||
} else {
|
||||
pidff->effect_operation_status->value[0] =
|
||||
pidff->operation_id[PID_EFFECT_START];
|
||||
pidff->effect_operation[PID_LOOP_COUNT].value[0] = n;
|
||||
pidff->effect_operation[PID_LOOP_COUNT].value[0] =
|
||||
pidff_clamp(n, pidff->effect_operation[PID_LOOP_COUNT].field);
|
||||
}
|
||||
|
||||
hid_hw_request(pidff->hid, pidff->reports[PID_EFFECT_OPERATION],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user