From: Mukunda, Vijendar Date: Tue, 8 May 2018 04:47:49 +0000 (+0530) Subject: ASoC: amd: memory release for rtd structure X-Git-Tag: v4.19~773^2~15^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cac6f59717e1084552e509172d40d5c9d278feb9;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Daniel Kurtz Signed-off-by: Mark Brown --- diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 39cd54f..1c44b26 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; }