aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMukunda, Vijendar <Vijendar.Mukunda@amd.com>2018-05-08 10:17:49 +0530
committerMark Brown <broonie@kernel.org>2018-05-21 16:19:04 +0100
commitcac6f59717e1084552e509172d40d5c9d278feb9 (patch)
tree3daba6df27c56332145e5fa8ebe5c12541ee4da2 /sound
parentASoC: amd: sram bank update changes (diff)
downloadlinux-dev-cac6f59717e1084552e509172d40d5c9d278feb9.tar.xz
linux-dev-cac6f59717e1084552e509172d40d5c9d278feb9.zip
ASoC: amd: memory release for rtd structure
rtd structure freed early may result in kernel panic in dma close call back. moved releasing memory for rtd structure to the end of dma close callback. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/amd/acp-pcm-dma.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 39cd54f1b493..1c44b26ad2db 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -998,8 +998,6 @@ static int acp_dma_close(struct snd_pcm_substream *substream)
DRV_NAME);
struct audio_drv_data *adata = dev_get_drvdata(component->dev);
- kfree(rtd);
-
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
adata->play_i2ssp_stream = NULL;
/*
@@ -1028,7 +1026,7 @@ static int acp_dma_close(struct snd_pcm_substream *substream)
*/
if (!adata->play_i2ssp_stream && !adata->capture_i2ssp_stream)
acp_reg_write(0, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB);
-
+ kfree(rtd);
return 0;
}