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

Commit 99e14c9d authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - Terminate the recursive connection search properly



The recursive search of widget connections in snd_hda_get_conn_index()
must be terminated at the pin and the audio-out widgets.  Otherwise
you'll get "too deep connection" warnings unnecessarily.

Reported-by: default avatarFrancis Moreau <francis.moro@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 26b9b559
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -579,9 +579,13 @@ int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,
		return -1;
	}
	recursive++;
	for (i = 0; i < nums; i++)
	for (i = 0; i < nums; i++) {
		unsigned int type = get_wcaps_type(get_wcaps(codec, conn[i]));
		if (type == AC_WID_PIN || type == AC_WID_AUD_OUT)
			continue;
		if (snd_hda_get_conn_index(codec, conn[i], nid, recursive) >= 0)
			return i;
	}
	return -1;
}
EXPORT_SYMBOL_HDA(snd_hda_get_conn_index);