]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ALSA: intel_hdmi: Fix reference to PCM buffer address
authorZhen Ni <nizhen@uniontech.com>
Wed, 2 Mar 2022 07:42:41 +0000 (15:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:09:31 +0000 (19:09 +0100)
commit 0aa6b294b312d9710804679abd2c0c8ca52cc2bc upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/x86/intel_hdmi_audio.c

index 9f9fcd2749f224d8ec09e8fae677991f60cc0c9f..dbaa43ffbbd2dca3001a9aec772a6e4ade9a369e 100644 (file)
@@ -1276,7 +1276,7 @@ static int had_pcm_mmap(struct snd_pcm_substream *substream,
 {
        vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
        return remap_pfn_range(vma, vma->vm_start,
-                       substream->dma_buffer.addr >> PAGE_SHIFT,
+                       substream->runtime->dma_addr >> PAGE_SHIFT,
                        vma->vm_end - vma->vm_start, vma->vm_page_prot);
 }