diff options
| author | John Keeping <[email protected]> | 2022-01-04 18:32:42 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2022-01-06 14:28:45 +0000 |
| commit | f2f69bf65df12176843ca11eab99949ba69e128b (patch) | |
| tree | ca2ae3749129df4f13c656b7ba24b1390e0685b5 /fs/ext4/fast_commit.c | |
| parent | usb: dwc2: gadget: initialize max_speed from params (diff) | |
| download | kernel-f2f69bf65df12176843ca11eab99949ba69e128b.tar.gz kernel-f2f69bf65df12176843ca11eab99949ba69e128b.zip | |
usb: gadget: u_audio: fix calculations for small bInterval
If bInterval is 1, then p_interval is 8000 and p_interval_mil is 8E9,
which is too big for a 32-bit value. While the storage is indeed
64-bit, this value is used as the divisor in do_div() which will
truncate it into a uint32_t leading to incorrect calculated values.
Switch back to keeping the base value in struct snd_uac_chip which fits
easily into an int, meaning that the division can be done in two steps
with the divisor fitting safely into a uint32_t on both steps.
Fixes: 6fec018a7e70 ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback")
Tested-by: Pavel Hofman <[email protected]>
Signed-off-by: John Keeping <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'fs/ext4/fast_commit.c')
0 files changed, 0 insertions, 0 deletions
