diff options
author | Daniel Mack <zonque@gmail.com> | 2013-03-19 16:09:24 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-03-20 03:42:35 -0400 |
commit | 4d7b86c98e445b075c2c4c3757eb6d3d6efbe72e (patch) | |
tree | 17f3fbf12cf3aa1263f1d68f6d7cb3f1e2b5af9c /sound | |
parent | 61ac51301e6c6d4ed977d7674ce2b8e713619a9b (diff) |
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: Daniel Mack <zonque@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/mixer.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 8eb84c0f7bf1..45cc0aff9c3e 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -715,8 +715,9 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ | |||
715 | case UAC2_CLOCK_SELECTOR: { | 715 | case UAC2_CLOCK_SELECTOR: { |
716 | struct uac_selector_unit_descriptor *d = p1; | 716 | struct uac_selector_unit_descriptor *d = p1; |
717 | /* call recursively to retrieve the channel info */ | 717 | /* call recursively to retrieve the channel info */ |
718 | if (check_input_term(state, d->baSourceID[0], term) < 0) | 718 | err = check_input_term(state, d->baSourceID[0], term); |
719 | return -ENODEV; | 719 | if (err < 0) |
720 | return err; | ||
720 | term->type = d->bDescriptorSubtype << 16; /* virtual type */ | 721 | term->type = d->bDescriptorSubtype << 16; /* virtual type */ |
721 | term->id = id; | 722 | term->id = id; |
722 | term->name = uac_selector_unit_iSelector(d); | 723 | 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 | return err; | 1358 | return err; |
1358 | 1359 | ||
1359 | /* determine the input source type and name */ | 1360 | /* determine the input source type and name */ |
1360 | if (check_input_term(state, hdr->bSourceID, &iterm) < 0) | 1361 | err = check_input_term(state, hdr->bSourceID, &iterm); |
1361 | return -EINVAL; | 1362 | if (err < 0) |
1363 | return err; | ||
1362 | 1364 | ||
1363 | master_bits = snd_usb_combine_bytes(bmaControls, csize); | 1365 | master_bits = snd_usb_combine_bytes(bmaControls, csize); |
1364 | /* master configuration quirks */ | 1366 | /* master configuration quirks */ |