@@ -372,12 +372,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
if (!rtd)
return NULL;
- INIT_LIST_HEAD(&rtd->component_list);
- rtd->card = card;
- rtd->dai_link = dai_link;
- if (!rtd->dai_link->ops)
- rtd->dai_link->ops = &null_snd_soc_ops;
-
rtd->codec_dais = kcalloc(dai_link->num_codecs,
sizeof(struct snd_soc_dai *),
GFP_KERNEL);
@@ -386,6 +380,12 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
return NULL;
}
+ INIT_LIST_HEAD(&rtd->component_list);
+ rtd->card = card;
+ rtd->dai_link = dai_link;
+ if (!rtd->dai_link->ops)
+ rtd->dai_link->ops = &null_snd_soc_ops;
+
/* see for_each_card_rtds */
list_add_tail(&rtd->list, &card->rtd_list);
rtd->num = card->num_rtd;