Commit 4d7b86c9 authored by Daniel Mack's avatar Daniel Mack Committed by Takashi Iwai

ALSA: snd-usb: mixer: propagate errors up the call chain

In check_input_term() and parse_audio_feature_unit(), propagate the
error value that has been returned by a failing function instead of
-EINVAL. That helps cleaning up the error pathes in the mixer.
Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 61ac5130
...@@ -715,8 +715,9 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ ...@@ -715,8 +715,9 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_
case UAC2_CLOCK_SELECTOR: { case UAC2_CLOCK_SELECTOR: {
struct uac_selector_unit_descriptor *d = p1; struct uac_selector_unit_descriptor *d = p1;
/* call recursively to retrieve the channel info */ /* call recursively to retrieve the channel info */
if (check_input_term(state, d->baSourceID[0], term) < 0) err = check_input_term(state, d->baSourceID[0], term);
return -ENODEV; if (err < 0)
return err;
term->type = d->bDescriptorSubtype << 16; /* virtual type */ term->type = d->bDescriptorSubtype << 16; /* virtual type */
term->id = id; term->id = id;
term->name = uac_selector_unit_iSelector(d); term->name = uac_selector_unit_iSelector(d);
...@@ -1357,8 +1358,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void ...@@ -1357,8 +1358,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
return err; return err;
/* determine the input source type and name */ /* determine the input source type and name */
if (check_input_term(state, hdr->bSourceID, &iterm) < 0) err = check_input_term(state, hdr->bSourceID, &iterm);
return -EINVAL; if (err < 0)
return err;
master_bits = snd_usb_combine_bytes(bmaControls, csize); master_bits = snd_usb_combine_bytes(bmaControls, csize);
/* master configuration quirks */ /* master configuration quirks */
......
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