Commit e8d0fee7 authored by Daniel Mack's avatar Daniel Mack Committed by Takashi Iwai

ALSA: usb-audio: fix feature unit parser for UAC2

Fix a small off-by-one bug which causes the feature unit to announce a
wrong number of channels. This leads to illegal requests sent to the
firmware eventually.
Signed-off-by: default avatarDaniel Mack <daniel@caiaq.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3ee317fe
...@@ -1126,7 +1126,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void ...@@ -1126,7 +1126,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
} else { } else {
struct uac2_feature_unit_descriptor *ftr = _ftr; struct uac2_feature_unit_descriptor *ftr = _ftr;
csize = 4; csize = 4;
channels = (hdr->bLength - 6) / 4; channels = (hdr->bLength - 6) / 4 - 1;
bmaControls = ftr->bmaControls; bmaControls = ftr->bmaControls;
} }
......
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