summaryrefslogtreecommitdiff
path: root/sound/pci/emu10k1/memory.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-06-17 16:30:27 +0200
committerTakashi Iwai <tiwai@suse.de>2008-06-17 16:30:27 +0200
commit284373059f9605442cac6453780f6aaecf9abac1 (patch)
treea4a449c3d19695dce2cff64deb2211c69c83eca8 /sound/pci/emu10k1/memory.c
parent9f515b6898d0f2c1b9eb34ae9986794045f34e2b (diff)
ALSA: emu10k1 - simplify the last fix
Clean up the previous commit for fixing memory leaks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1/memory.c')
-rw-r--r--sound/pci/emu10k1/memory.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index 759e29f89478..7d379f5131fb 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -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 |
__GFP_NOWARN);
if (!p || (page_to_pfn(p) & ~(emu->dma_mask >> PAGE_SHIFT))) {
+ if (p)
+ __free_page(p);
/* try to allocate from <16MB zone */
- struct page *p1 =
- alloc_page(GFP_ATOMIC | GFP_DMA |
+ p = 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);