Skip to content

Commit 54e1bf9

Browse files
imtangmengbroonie
authored andcommitted
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. Fixes: cab396d ("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>
1 parent 9531a63 commit 54e1bf9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/amd/vangogh/acp5x-pcm-dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static int acp5x_dma_hw_params(struct snd_soc_component *component,
281281
return -EINVAL;
282282
}
283283
size = params_buffer_bytes(params);
284-
rtd->dma_addr = substream->dma_buffer.addr;
284+
rtd->dma_addr = substream->runtime->dma_addr;
285285
rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT);
286286
config_acp5x_dma(rtd, substream->stream);
287287
return 0;

0 commit comments

Comments
 (0)