Skip to contentSkip to conversation

Patch "ALSA: usb-audio: Add check return value for usb_string()" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Dec 11, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ALSA: usb-audio: Add check return value for usb_string()

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
alsa-usb-audio-add-check-return-value-for-usb_string.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 89b89d121ffcf8d9546633b98ded9d18b8f75891 Mon Sep 17 00:00:00 2001

From: Jaejoong Kim <[email protected]>
Date: Mon, 4 Dec 2017 15:31:49 +0900
Subject: ALSA: usb-audio: Add check return value for usb_string()

From: Jaejoong Kim <[email protected]>

commit 89b89d121ffcf8d9546633b98ded9d18b8f75891 upstream.

snd_usb_copy_string_desc() returns zero if usb_string() fails. In case of failure, we need to check the snd_usb_copy_string_desc()'s return value and add an exception case

---
 sound/usb/mixer.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
sound/usb/mixer.c +5 -4
@@ -2106,13 +2106,14 @@ static int parse_audio_selector_unit(str
 	if (len)
 		;
 	else if (nameid)
-		snd_usb_copy_string_desc(state, nameid, kctl->id.name,
+		len = snd_usb_copy_string_desc(state, nameid, kctl->id.name,
 					 sizeof(kctl->id.name));
-	else {
+	else
 		len = get_term_name(state, &state->oterm,
 				    kctl->id.name, sizeof(kctl->id.name), 0);
-		if (!len)
-			strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name));
+
+	if (!len) {
+		strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name));
 
 		if (desc->bDescriptorSubtype == UAC2_CLOCK_SELECTOR)
 			append_ctl_name(kctl, " Clock Source");

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/alsa-usb-audio-add-check-return-value-for-usb_string.patch queue-4.4/alsa-usb-audio-fix-out-of-bound-error.patch