Skip to contentSkip to conversation

ALSA: jack: Fix the id uniqueness check

PATCH New Takashi Iwai 1 participant 1 message May 29, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: jack: Fix the id uniqueness check

snd_kctl_jack_new() tries to assign a unique index number when a name string that has been already registered is passed. However, it checks with the base string without "Jack" suffix, so it never hits. Fix the call with the properly processed name string instead.

Fixes b8dd086674cf 'ALSA: Jack: handle jack embedded kcontrol creating within ctljack')
---
 sound/core/ctljack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/ctljack.c +1 -1
index 8f8d1033425c..9149a4aefa95 100644
@@ -70,7 +70,7 @@ snd_kctl_jack_new(const char *name, struct snd_card *card)
 		return NULL;
 
 	jack_kctl_name_gen(kctl->id.name, name, sizeof(kctl->id.name));
-	kctl->id.index = get_available_index(card, name);
+	kctl->id.index = get_available_index(card, kctl->id.name);
 	kctl->private_value = 0;
 	return kctl;
 }
Signature · 1 line
2.4.2