• Takashi Iwai's avatar
    ALSA: usb-audio: Fix parse of UAC2 Extension Units · ca95c7bf
    Takashi Iwai authored
    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: 23caaf19 ("ALSA: usb-mixer: Add support for Audio Class v2.0")
    Reported-by: default avatarStefan Sauer <ensonic@hora-obscura.de>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    ca95c7bf
mixer.c 95.3 KB