Skip to content

Commit

Permalink
ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+)
Browse files Browse the repository at this point in the history
The driver worked around an error in the MAYA44 USB(+)'s mixer unit
descriptor by aborting before parsing the missing field.  However,
aborting parsing too early prevented parsing of the other units
connected to this unit, so the capture mixer controls would be missing.

Fix this by moving the check for this descriptor error after the parsing
of the unit's input pins.

Reported-by: nightmixes <nightmixes@gmail.com>
Tested-by: nightmixes <nightmixes@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Jun 3, 2015
1 parent 044bddb commit ea114fc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,19 +1583,16 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid,
unitid);
return -EINVAL;
}
/* no bmControls field (e.g. Maya44) -> ignore */
if (desc->bLength <= 10 + input_pins) {
usb_audio_dbg(state->chip, "MU %d has no bmControls field\n",
unitid);
return 0;
}

num_ins = 0;
ich = 0;
for (pin = 0; pin < input_pins; pin++) {
err = parse_audio_unit(state, desc->baSourceID[pin]);
if (err < 0)
continue;
/* no bmControls field (e.g. Maya44) -> ignore */
if (desc->bLength <= 10 + input_pins)
continue;
err = check_input_term(state, desc->baSourceID[pin], &iterm);
if (err < 0)
return err;
Expand Down

0 comments on commit ea114fc

Please sign in to comment.