[PATCH] ALSA: usb-audio: fix feature unit parser for UAC2
27 May
2010
27 May
'10
6:28 p.m.
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 --- sound/usb/mixer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 97dd176..03ce971 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; }
--
1.7.1
5323
Age (days ago)
5323
Last active (days ago)
0 comments
1 participants
participants (1)
-
Daniel Mack