Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2168,11 +2168,21 @@ static int soc_probe(struct platform_device *pdev)
static int soc_cleanup_card_resources(struct snd_soc_card *card)
{
struct snd_soc_pcm_runtime *rtd;
struct snd_soc_component *component;
int ret;

/* make sure any delayed work runs */
list_for_each_entry(rtd, &card->rtd_list, list)
flush_delayed_work(&rtd->delayed_work);

/* remove dynamic controls for all component driver */
list_for_each_entry(component, &card->component_dev_list, card_list) {
ret = snd_soc_tplg_component_remove(component, SND_SOC_TPLG_INDEX_ALL);
if (ret < 0)
dev_err(component->dev,
"error: component free failed %d\n", ret);
}

/* free the ALSA card at first; this syncs with pending operations */
snd_card_free(card->snd_card);

Expand Down
1 change: 1 addition & 0 deletions sound/soc/soc-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ static void remove_widget(struct snd_soc_component *comp,
}

free_news:
list_del(&dobj->list);
kfree(w->kcontrol_news);

/* widget w is freed by soc-dapm.c */
Expand Down