Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f085549 authored by Takashi Iwai's avatar Takashi Iwai Committed by Linus Torvalds
Browse files

[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: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 14c65f98
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1055,6 +1055,12 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
	const char **s;
	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);
	if (!kctl)
		return -ENOMEM;