Patchwork [3.5.y.z,extended,stable] Patch "ALSA: snd-usb: mixer: propagate errors up the call chain" has been added to staging queue

login
register
mail settings
Submitter Luis Henriques
Date March 25, 2013, 6:02 p.m.
Message ID <1364234552-9042-1-git-send-email-luis.henriques@canonical.com>
Download mbox | patch
Permalink /patch/230880/
State New
Headers show

Comments

Luis Henriques - March 25, 2013, 6:02 p.m.
This is a note to let you know that I have just added a patch titled

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

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

From aac73afdcfc96ee4456b1a7ef231d324d5c0689b Mon Sep 17 00:00:00 2001
From: Daniel Mack <zonque@gmail.com>
Date: Tue, 19 Mar 2013 21:09:24 +0100
Subject: [PATCH] ALSA: snd-usb: mixer: propagate errors up the call chain

commit 4d7b86c98e445b075c2c4c3757eb6d3d6efbe72e upstream.

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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Luis Henriques <luis.henriques@canonical.com>
---
 sound/usb/mixer.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--
1.8.1.2

Patch

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 41e8bfb..1b523a1 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -711,8 +711,9 @@  static int check_input_term(struct mixer_build *state, int id, struct usb_audio_
 		case UAC2_CLOCK_SELECTOR: {
 			struct uac_selector_unit_descriptor *d = p1;
 			/* call recursively to retrieve the channel info */
-			if (check_input_term(state, d->baSourceID[0], term) < 0)
-				return -ENODEV;
+			err = check_input_term(state, d->baSourceID[0], term);
+			if (err < 0)
+				return err;
 			term->type = d->bDescriptorSubtype << 16; /* virtual type */
 			term->id = id;
 			term->name = uac_selector_unit_iSelector(d);
@@ -1283,8 +1284,9 @@  static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
 		return err;

 	/* determine the input source type and name */
-	if (check_input_term(state, hdr->bSourceID, &iterm) < 0)
-		return -EINVAL;
+	err = check_input_term(state, hdr->bSourceID, &iterm);
+	if (err < 0)
+		return err;

 	master_bits = snd_usb_combine_bytes(bmaControls, csize);
 	/* master configuration quirks */