Skip to content

Commit f95077a

Browse files
committed
Merge tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull additional sound fix from Takashi Iwai: "A regression fix for the latest memalloc helper change" * tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: memalloc: Try dma_alloc_noncontiguous() at first
2 parents 8f2975c + 9d8e536 commit f95077a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sound/core/memalloc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,18 +542,17 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
542542
struct sg_table *sgt;
543543
void *p;
544544

545+
sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir,
546+
DEFAULT_GFP, 0);
545547
#ifdef CONFIG_SND_DMA_SGBUF
546-
if (!get_dma_ops(dmab->dev.dev)) {
548+
if (!sgt && !get_dma_ops(dmab->dev.dev)) {
547549
if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG)
548550
dmab->dev.type = SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK;
549551
else
550552
dmab->dev.type = SNDRV_DMA_TYPE_DEV_SG_FALLBACK;
551553
return snd_dma_sg_fallback_alloc(dmab, size);
552554
}
553555
#endif
554-
555-
sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir,
556-
DEFAULT_GFP, 0);
557556
if (!sgt)
558557
return NULL;
559558

0 commit comments

Comments
 (0)