Re: [PATCH 1/1] ASoC: simple-card-utils: fix priv->dai_props indexing

From: Kuninori Morimoto
Date: Tue Jan 14 2025 - 18:29:14 EST



Hi Laurentiu

> From: Laurentiu Mihalcea <laurentiu.mihalcea@xxxxxxx>
>
> 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@xxxxxxx>
> ---

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

Thank you for your help !!

Best regards
---
Kuninori Morimoto