Commit 775a5ddc authored by Torstein Hegge's avatar Torstein Hegge Committed by Greg Kroah-Hartman

ALSA: usb: Parse UAC2 extension unit like for UAC1

commit 61ac5130 upstream.

UAC2_EXTENSION_UNIT_V2 differs from UAC1_EXTENSION_UNIT, but can be handled in
the same way when parsing the unit. Otherwise parse_audio_unit() fails when it
sees an extension unit on a UAC2 device.

UAC2_EXTENSION_UNIT_V2 is outside the range allocated by UAC1.
Signed-off-by: default avatarTorstein Hegge <hegge@resisty.net>
Acked-by: default avatarDaniel Mack <zonque@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Cc: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d47b3725
...@@ -722,7 +722,8 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ ...@@ -722,7 +722,8 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_
case UAC1_PROCESSING_UNIT: case UAC1_PROCESSING_UNIT:
case UAC1_EXTENSION_UNIT: case UAC1_EXTENSION_UNIT:
/* UAC2_PROCESSING_UNIT_V2 */ /* UAC2_PROCESSING_UNIT_V2 */
/* UAC2_EFFECT_UNIT */ { /* UAC2_EFFECT_UNIT */
case UAC2_EXTENSION_UNIT_V2: {
struct uac_processing_unit_descriptor *d = p1; struct uac_processing_unit_descriptor *d = p1;
if (state->mixer->protocol == UAC_VERSION_2 && if (state->mixer->protocol == UAC_VERSION_2 &&
...@@ -1975,6 +1976,8 @@ static int parse_audio_unit(struct mixer_build *state, int unitid) ...@@ -1975,6 +1976,8 @@ static int parse_audio_unit(struct mixer_build *state, int unitid)
return parse_audio_extension_unit(state, unitid, p1); return parse_audio_extension_unit(state, unitid, p1);
else /* UAC_VERSION_2 */ else /* UAC_VERSION_2 */
return parse_audio_processing_unit(state, unitid, p1); return parse_audio_processing_unit(state, unitid, p1);
case UAC2_EXTENSION_UNIT_V2:
return parse_audio_extension_unit(state, unitid, p1);
default: default:
snd_printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]); snd_printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment