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

Commit bae84e70 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - Fix access-after-free in patch_realtek.c



alc_free_kctls() has to be called after all jobs done in alc_build_controls().

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ea823c08
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -2532,8 +2532,6 @@ static int alc_build_controls(struct hda_codec *codec)
			return err;
			return err;
	}
	}
	alc_free_kctls(codec); /* no longer needed */
	/* assign Capture Source enums to NID */
	/* assign Capture Source enums to NID */
	kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
	kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
	if (!kctl)
	if (!kctl)
@@ -2602,6 +2600,9 @@ static int alc_build_controls(struct hda_codec *codec)
			}
			}
		}
		}
	}
	}
	alc_free_kctls(codec); /* no longer needed */
	return 0;
	return 0;
}
}