From 9e5e7c232ac48f59c6b7fa215d14fb6861b92d92 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 17 Jun 2008 16:20:13 +0200 Subject: [PATCH] --- yaml --- r: 99121 b: refs/heads/master c: 9f515b6898d0f2c1b9eb34ae9986794045f34e2b h: refs/heads/master i: 99119: a4ff8574ed2a4747f75fce51fb8e654689d69b4f v: v3 --- [refs] | 2 +- trunk/sound/pci/emu10k1/memory.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index bc580a7607e3..46167c4d89f9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6719292af5513da52aa876d0e7ac4367a0851845 +refs/heads/master: 9f515b6898d0f2c1b9eb34ae9986794045f34e2b diff --git a/trunk/sound/pci/emu10k1/memory.c b/trunk/sound/pci/emu10k1/memory.c index 42943b4fcb7b..759e29f89478 100644 --- a/trunk/sound/pci/emu10k1/memory.c +++ b/trunk/sound/pci/emu10k1/memory.c @@ -464,11 +464,17 @@ static int synth_alloc_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk /* first try to allocate from <4GB zone */ struct page *p = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_NOWARN); - if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT))) + if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT))) { /* try to allocate from <16MB zone */ - p = alloc_page(GFP_ATOMIC | GFP_DMA | + struct page *p1 = + alloc_page(GFP_ATOMIC | GFP_DMA | __GFP_NORETRY | /* no OOM-killer */ __GFP_NOWARN); + /* free page outside dma_mask range */ + if (p) + free_page((unsigned long)page_address(p)); + p = p1; + } if (!p) { __synth_free_pages(emu, first_page, page - 1); return -ENOMEM;