Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: intel_hdmi: 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.

Signed-off-by: Zhen Ni <nizhen@uniontech.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220302074241.30469-1-nizhen@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Zhen Ni and committed by
Takashi Iwai
0aa6b294 ce345f1e

+1 -1
+1 -1
sound/x86/intel_hdmi_audio.c
··· 1261 1261 { 1262 1262 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 1263 1263 return remap_pfn_range(vma, vma->vm_start, 1264 - substream->dma_buffer.addr >> PAGE_SHIFT, 1264 + substream->runtime->dma_addr >> PAGE_SHIFT, 1265 1265 vma->vm_end - vma->vm_start, vma->vm_page_prot); 1266 1266 } 1267 1267