Skip to content

Commit

Permalink
ASoC: core: only flush inited work during free
Browse files Browse the repository at this point in the history
There are many paths to soc_free_pcm_runtime which can both have and
have not yet inited the workqueue yet. When we flush the queue when we
have not yet inited the queue we cause warnings to be printed.

An example is soc_cleanup_card_resources which is called by
snd_soc_bind_card which has multiple failure points before and after
soc_link_init -> soc_new_pcm which is where the queue is inited.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20191128011358.39234-1-cujomalainey@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Curtis Malainey authored and Mark Brown committed Dec 9, 2019
1 parent 7eccc05 commit 9c9b652
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd)

list_del(&rtd->list);

flush_delayed_work(&rtd->delayed_work);
if (delayed_work_pending(&rtd->delayed_work))
flush_delayed_work(&rtd->delayed_work);
snd_soc_pcm_component_free(rtd);

/*
Expand Down

0 comments on commit 9c9b652

Please sign in to comment.