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

Commit cf1f7c6e authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: Fix early event callback list iteration



The power_list field is used when adding a widget to a power sequence list. Use
the same field when iterating the list using list_for_each_entry, otherwise
we'll see undefined behavior.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 7d0cd223
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1738,11 +1738,11 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
					&async_domain);
	async_synchronize_full_domain(&async_domain);

	list_for_each_entry(w, &down_list, list) {
	list_for_each_entry(w, &down_list, power_list) {
		dapm_seq_check_event(dapm, w, SND_SOC_DAPM_WILL_PMD);
	}

	list_for_each_entry(w, &up_list, list) {
	list_for_each_entry(w, &up_list, power_list) {
		dapm_seq_check_event(dapm, w, SND_SOC_DAPM_WILL_PMU);
	}