Unverified Commit bf266d80 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15796 ALSA: hda/via: Avoid potential array out-of-bound in add_secret_dac_path()

parents b361e5fc 07c16879
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -833,6 +833,9 @@ static int add_secret_dac_path(struct hda_codec *codec)
		return 0;
	nums = snd_hda_get_connections(codec, spec->gen.mixer_nid, conn,
				       ARRAY_SIZE(conn) - 1);
	if (nums < 0)
		return nums;

	for (i = 0; i < nums; i++) {
		if (get_wcaps_type(get_wcaps(codec, conn[i])) == AC_WID_AUD_OUT)
			return 0;