linux/sound/firewire
Geert Uytterhoeven 9f65df9c58 ALSA: firewire-tascam: Fix integer overflow in midi_port_work()
As snd_fw_async_midi_port.consume_bytes is unsigned int, and
NSEC_PER_SEC is 1000000000L, the second multiplication in

    port->consume_bytes * 8 * NSEC_PER_SEC / 31250

always overflows on 32-bit platforms, truncating the result.  Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.

Note that this assumes port->consume_bytes <= 16777.

Fixes: 531f471834 ("ALSA: firewire-lib/firewire-tascam: localize async midi port")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210111130251.361335-3-geert+renesas@glider.be
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-12 14:57:38 +01:00
..
bebob ALSA: bebob: potential info leak in hwdep_read() 2020-10-07 17:33:52 +02:00
dice
digi00x
fireface ALSA: fireface: Fix integer overflow in transmit_midi_msg() 2021-01-12 14:57:29 +01:00
fireworks ALSA: firewire: Clean up a locking issue in copy_resp_to_buf() 2020-11-13 18:37:22 +01:00
motu
oxfw
tascam ALSA: firewire-tascam: Fix integer overflow in midi_port_work() 2021-01-12 14:57:38 +01:00
amdtp-am824.c
amdtp-am824.h
amdtp-stream-trace.h
amdtp-stream.c
amdtp-stream.h ALSA: firewire: fix comparison to bool warning 2020-11-10 09:06:10 +01:00
cmp.c
cmp.h
fcp.c
fcp.h
isight.c
iso-resources.c
iso-resources.h
Kconfig
lib.c
lib.h
Makefile
packets-buffer.c
packets-buffer.h