ASoC: SOF: pcm: fix resource leak in hw_free
authorKai Vehmanen <kai.vehmanen@linux.intel.com>
Fri, 27 Sep 2019 20:05:30 +0000 (15:05 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 1 Oct 2019 17:31:06 +0000 (18:31 +0100)
commite66e52c5b7422824cedf0084c0766602dea7e8a7
treed7f5ab4eee5f8a3364650eba36312a0aea2463a4
parent2e305a074061121220a2828f97a57d315cf8efba
ASoC: SOF: pcm: fix resource leak in hw_free

Fix a bug in sof_pcm_hw_free() where some cleanup actions were
skipped if STREAM_PCM_FREE IPC was already successfully sent to
DSP when the stream was stopped or suspended. This is incorrect
as hw_free should clean up also other resources, including pcm
lib page allocations, period elapsed work queue and call to
platform hw_free.

Fixes: c29d96c3b9b4 ("ASoC: SOF: reset DMA state in prepare")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190927200538.660-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/pcm.c