]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: simple-card-utils: fix priv->dai_props indexing
authorLaurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Tue, 14 Jan 2025 18:43:14 +0000 (13:43 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 15 Jan 2025 13:11:12 +0000 (13:11 +0000)
commit04e97fa7dd7e3eda754712f92df2136acd1d9088
tree92693be23e941e376de4b319604cba24ff220e40
parentd5a4d7f10fcdcae952f7d5c603c61795c0abb7a7
ASoC: simple-card-utils: fix priv->dai_props indexing

As of commit cb18cd26039f ("ASoC: soc-core: do rtd->id trick at
snd_soc_add_pcm_runtime()") the ID stored in the PCM runtime data can
no longer be safely used to index the priv->dai_props array. This is
because the ID may be modified during snd_soc_add_pcm_runtime(), thus
resulting in an ID that's no longer a valid array index.

To fix this, use the position of the dai_link stored inside the PCM
runtime data relative to the start of the dai_link array as index into
the priv->dai_props array.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20250114184314.3583-2-laurentiumihalcea111@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/simple_card_utils.h
sound/soc/generic/simple-card-utils.c