summaryrefslogtreecommitdiff
path: root/sound/soc/amd/acp-pcm-dma.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-07-31 10:43:31 +0200
committerMark Brown <broonie@kernel.org>2021-08-02 12:14:00 +0100
commit8b5d95313b6d30f642e4ed0125891984c446604e (patch)
tree13a26568ea814f2be05e1424ffe48757ce19d509 /sound/soc/amd/acp-pcm-dma.c
parent1d25684e22516f1cff77176d288b1da02fff57bb (diff)
ASoC: amd: Fix reference to PCM buffer address
PCM buffers might be allocated dynamically when the buffer preallocation failed or a larger buffer is requested, and it's not guaranteed that substream->dma_buffer points to the actually used buffer. The driver needs to refer to substream->runtime->dma_addr instead for the buffer address. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20210731084331.32225-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/acp-pcm-dma.c')
-rw-r--r--sound/soc/amd/acp-pcm-dma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 143155a840ac..cc1ce6f22caa 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -969,7 +969,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component,
acp_set_sram_bank_state(rtd->acp_mmio, 0, true);
/* Save for runtime private data */
- rtd->dma_addr = substream->dma_buffer.addr;
+ rtd->dma_addr = runtime->dma_addr;
rtd->order = get_order(size);
/* Fill the page table entries in ACP SRAM */