X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=blobdiff_plain;f=sound%2Fsoc%2Fsoc-core.c;h=180bfbfe833da3c53a32a1845392d2af554e3929;hp=6bd593dc9b549a3b4758081ee74e555501f4fd8b;hb=2016d5ed401133539779d8a070abbe42fe9cb3da;hpb=7d3d6e0645dd3689e625161b9e312108e66b2b51 diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6bd593dc9b54..180bfbfe833d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2317,6 +2317,9 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) list_for_each_entry(rtd, &card->rtd_list, list) flush_delayed_work(&rtd->delayed_work); + /* free the ALSA card at first; this syncs with pending operations */ + snd_card_free(card->snd_card); + /* remove and free each DAI */ soc_remove_dai_links(card); soc_remove_pcm_runtimes(card); @@ -2331,9 +2334,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) if (card->remove) card->remove(card); - snd_card_free(card->snd_card); return 0; - } /* removes a socdev */