From e8d0fee70b66694959eab10c41788b9279d73629 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Thu, 27 May 2010 20:15:14 +0200 Subject: 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: Daniel Mack Signed-off-by: Takashi Iwai --- sound/usb/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/usb') diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 97dd17655104..03ce971e0027 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -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; } -- cgit v1.2.3