Skip to content

Commit

Permalink
ALSA: usb-audio: fix feature unit parser for UAC2
Browse files Browse the repository at this point in the history
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: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed May 28, 2010
1 parent 3ee317f commit e8d0fee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
} else {
struct uac2_feature_unit_descriptor *ftr = _ftr;
csize = 4;
channels = (hdr->bLength - 6) / 4;
channels = (hdr->bLength - 6) / 4 - 1;
bmaControls = ftr->bmaControls;
}

Expand Down

0 comments on commit e8d0fee

Please sign in to comment.