]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Fix parse of UAC2 Extension Units
authorTakashi Iwai <tiwai@suse.de>
Thu, 4 Jul 2019 14:31:12 +0000 (16:31 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 5 Jul 2019 06:06:47 +0000 (08:06 +0200)
commit33c93fb02929120b71aca51cc69b7ade0de79658
tree13a802819035ac0c628b6a8e41976ba6eed842b3
parent8fc2d6054db62cb552004ef3273b5b9150d9a1f4
ALSA: usb-audio: Fix parse of UAC2 Extension Units

Extension Unit (XU) is used to have a compatible layout with
Processing Unit (PU) on UAC1, and the usb-audio driver code assumed it
for parsing the descriptors.  Meanwhile, on UAC2, XU became slightly
incompatible with PU; namely, XU has a one-byte bmControls bitmap
while PU has two bytes bmControls bitmap.  This incompatibility
results in the read of a wrong address for the last iExtension field,
which ended up with an incorrect string for the mixer element name, as
recently reported for Focusrite Scarlett 18i20 device.

This patch corrects this misalignment by introducing a couple of new
macros and calling them depending on the descriptor type.

Fixes: 107848d1777b ("ALSA: usb-mixer: Add support for Audio Class v2.0")
Reported-by: Stefan Sauer <ensonic@hora-obscura.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/uapi/linux/usb/audio.h
sound/usb/mixer.c