Skip to content

Commit

Permalink
ALSA: jack: Fix the id uniqueness check
Browse files Browse the repository at this point in the history
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: b8dd086 'ALSA: Jack: handle jack embedded kcontrol creating within ctljack')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed May 29, 2015
1 parent 28760c1 commit d0a601c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/ctljack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d0a601c

Please sign in to comment.