Skip to content

Commit

Permalink
ALSA: emu10k1 - simplify the last fix
Browse files Browse the repository at this point in the history
Clean up the previous commit for fixing memory leaks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jun 17, 2008
1 parent 9f515b6 commit 2843730
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sound/pci/emu10k1/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2843730

Please sign in to comment.