linux/sound/firewire
Takashi Sakamoto c1839501fe ALSA: firewire-lib: fix wrong value as length of header for CIP_NO_HEADER case
In a commit 1d717123bb ("ALSA: firewire-lib: Avoid
-Wflex-array-member-not-at-end warning"), DEFINE_FLEX() macro was used to
handle variable length of array for header field in struct fw_iso_packet
structure. The usage of macro has a side effect that the designated
initializer assigns the count of array to the given field. Therefore
CIP_HEADER_QUADLETS (=2) is assigned to struct fw_iso_packet.header,
while the original designated initializer assigns zero to all fields.

With CIP_NO_HEADER flag, the change causes invalid length of header in
isochronous packet for 1394 OHCI IT context. This bug affects all of
devices supported by ALSA fireface driver; RME Fireface 400, 800, UCX, UFX,
and 802.

This commit fixes the bug by replacing it with the alternative version of
macro which corresponds no initializer.

Cc: stable@vger.kernel.org
Fixes: 1d717123bb ("ALSA: firewire-lib: Avoid -Wflex-array-member-not-at-end warning")
Reported-by: Edmund Raile <edmund.raile@proton.me>
Closes: https://lore.kernel.org/r/rrufondjeynlkx2lniot26ablsltnynfaq2gnqvbiso7ds32il@qk4r6xps7jh2/
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240725155640.128442-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-27 10:28:36 +09:00
..
bebob ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
dice ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
digi00x ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
fireface ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
fireworks ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
motu ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
oxfw ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
tascam ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
amdtp-am824.c
amdtp-am824.h
amdtp-stream-trace.h
amdtp-stream.c ALSA: firewire-lib: fix wrong value as length of header for CIP_NO_HEADER case 2024-07-27 10:28:36 +09:00
amdtp-stream.h ALSA: firewire-lib: handle quirk to calculate payload quadlets as data block counter 2024-02-19 09:24:35 +01:00
cmp.c
cmp.h
fcp.c
fcp.h
isight.c
iso-resources.c
iso-resources.h
Kconfig ALSA: firewire-motu: add support for MOTU 896 mk3 FireWire and Hybrid 2024-01-29 09:04:30 +01:00
lib.c
lib.h
Makefile ALSA: firewire: Use *-y instead of *-objs in Makefile 2024-05-08 18:18:03 +02:00
packets-buffer.c
packets-buffer.h