mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
[ALSA] hda-codec - Don't create vmaster if no slaves found
Don't create vmaster controls if no slaves are found in the given list. This prevents the error due to an empty vmaster control. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
14c65f98bf
commit
2f08554977
1 changed files with 6 additions and 0 deletions
|
@ -1055,6 +1055,12 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
|
||||||
const char **s;
|
const char **s;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++)
|
||||||
|
;
|
||||||
|
if (!*s) {
|
||||||
|
snd_printdd("No slave found for %s\n", name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
kctl = snd_ctl_make_virtual_master(name, tlv);
|
kctl = snd_ctl_make_virtual_master(name, tlv);
|
||||||
if (!kctl)
|
if (!kctl)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue