Commit cac6f597 authored by Mukunda, Vijendar's avatar Mukunda, Vijendar Committed by Mark Brown

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: default avatarVijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 18e8a40d
...@@ -998,8 +998,6 @@ static int acp_dma_close(struct snd_pcm_substream *substream) ...@@ -998,8 +998,6 @@ static int acp_dma_close(struct snd_pcm_substream *substream)
DRV_NAME); DRV_NAME);
struct audio_drv_data *adata = dev_get_drvdata(component->dev); struct audio_drv_data *adata = dev_get_drvdata(component->dev);
kfree(rtd);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
adata->play_i2ssp_stream = NULL; adata->play_i2ssp_stream = NULL;
/* /*
...@@ -1028,7 +1026,7 @@ static int acp_dma_close(struct snd_pcm_substream *substream) ...@@ -1028,7 +1026,7 @@ static int acp_dma_close(struct snd_pcm_substream *substream)
*/ */
if (!adata->play_i2ssp_stream && !adata->capture_i2ssp_stream) if (!adata->play_i2ssp_stream && !adata->capture_i2ssp_stream)
acp_reg_write(0, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); acp_reg_write(0, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB);
kfree(rtd);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment