Skip to content

Commit eda80d7

Browse files
committed
ALSA: memalloc: Fix regression with SNDRV_DMA_TYPE_CONTINUOUS
The recent code refactoring made the mmap of continuous pages to be done via the own helper snd_dma_continuous_mmap() with remap_pfn_range(). There I overlooked that dmab->addr isn't set for the allocation with SNDRV_DMA_TYPE_CONTINUOUS. This resulted always in an error at mmap with this buffer type on the system such as Intel SST Baytrail driver. This patch fixes the regression by passing the correct address. Fixes: 30b7ba6 ("ALSA: core: Add continuous and vmalloc mmap ops") Reported-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 852a8a9 commit eda80d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/core/memalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int snd_dma_continuous_mmap(struct snd_dma_buffer *dmab,
215215
struct vm_area_struct *area)
216216
{
217217
return remap_pfn_range(area, area->vm_start,
218-
dmab->addr >> PAGE_SHIFT,
218+
page_to_pfn(virt_to_page(dmab->area)),
219219
area->vm_end - area->vm_start,
220220
area->vm_page_prot);
221221
}

0 commit comments

Comments
 (0)