diff options
author | Meng Tang <tangmeng@uniontech.com> | 2022-03-16 12:13:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-08 15:23:22 +0300 |
commit | c2e5f5d23718dbc4d9ce21c69d78d32f2eaa1ec8 (patch) | |
tree | 9e0375e9c83c18b6b40d8a47b0c4ac2f2a5f8867 | |
parent | 2f44eca78cc6d4e1779eb95765ec79e433accab4 (diff) | |
download | linux-c2e5f5d23718dbc4d9ce21c69d78d32f2eaa1ec8.tar.xz |
ASoC: amd: Fix reference to PCM buffer address
[ Upstream commit 54e1bf9f6177a3ffbd920474f4481a25361163aa ]
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.
Fixes: cab396d8b22c1 ("ASoC: amd: add ACP5x pcm dma driver ops")
Signed-off-by: Meng Tang <tangmeng@uniontech.com>
Link: https://lore.kernel.org/r/20220316091303.9745-1-tangmeng@uniontech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c index f10de38976cb..6abcc2133a2c 100644 --- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c +++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c @@ -281,7 +281,7 @@ static int acp5x_dma_hw_params(struct snd_soc_component *component, return -EINVAL; } size = params_buffer_bytes(params); - rtd->dma_addr = substream->dma_buffer.addr; + rtd->dma_addr = substream->runtime->dma_addr; rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); config_acp5x_dma(rtd, substream->stream); return 0; |