diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index e3f6a6dc0f368a..1e36cb781095b3 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -264,8 +264,6 @@ static int sof_pcm_hw_free(struct snd_pcm_substream *substream) snd_pcm_lib_free_pages(substream); - cancel_work_sync(&spcm->stream[substream->stream].period_elapsed_work); - if (ret < 0) return ret; @@ -522,6 +520,8 @@ static int sof_pcm_close(struct snd_pcm_substream *substream) */ } + cancel_work_sync(&spcm->stream[substream->stream].period_elapsed_work); + return 0; }