From df11e734e55a2ca63bdf22a4a95a74a6482ca220 Mon Sep 17 00:00:00 2001 From: Viraj Karandikar Date: Fri, 29 May 2015 18:11:00 +0530 Subject: [PATCH] tegra-alt: adsp: free compress buffer on stream close Free of compress stream buffer. Fix freeing of PCM capture buffer. Bug 200056741 Change-Id: Ia64ba3206563f0d22f30bca1bab9349a7a5ca0dd Signed-off-by: Viraj Karandikar Reviewed-on: http://git-master/r/748714 (cherry picked from commit 9cc04c256d3e8b56f4264d5f246d773a3192a1ca) Reviewed-on: http://git-master/r/751863 --- sound/soc/tegra-alt/tegra210_adsp_alt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index 436c7d81..779a62b5 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -951,6 +951,8 @@ static int tegra210_adsp_compr_free(struct snd_compr_stream *cstream) pm_runtime_put(prtd->dev); + tegra210_adsp_deallocate_dma_buffer(&prtd->buf); + prtd->fe_apm->fe = 0; cstream->runtime->private_data = NULL; devm_kfree(prtd->dev, prtd); @@ -1472,7 +1474,7 @@ static void tegra210_adsp_pcm_free(struct snd_pcm *pcm) tegra210_adsp_deallocate_dma_buffer( &pcm->streams[stream].substream->dma_buffer); } - if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { + if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { int stream = SNDRV_PCM_STREAM_CAPTURE; tegra210_adsp_deallocate_dma_buffer(