Commit 28437305 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: emu10k1 - simplify the last fix

Clean up the previous commit for fixing memory leaks.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 9f515b68
...@@ -465,15 +465,12 @@ static int synth_alloc_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk ...@@ -465,15 +465,12 @@ static int synth_alloc_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk
struct page *p = alloc_page(GFP_KERNEL | GFP_DMA32 | struct page *p = alloc_page(GFP_KERNEL | GFP_DMA32 |
__GFP_NOWARN); __GFP_NOWARN);
if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT))) { if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT))) {
if (p)
__free_page(p);
/* try to allocate from <16MB zone */ /* try to allocate from <16MB zone */
struct page *p1 = p = alloc_page(GFP_ATOMIC | GFP_DMA |
alloc_page(GFP_ATOMIC | GFP_DMA |
__GFP_NORETRY | /* no OOM-killer */ __GFP_NORETRY | /* no OOM-killer */
__GFP_NOWARN); __GFP_NOWARN);
/* free page outside dma_mask range */
if (p)
free_page((unsigned long)page_address(p));
p = p1;
} }
if (!p) { if (!p) {
__synth_free_pages(emu, first_page, page - 1); __synth_free_pages(emu, first_page, page - 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment