Skip to content

Commit

Permalink
uml: fix order of pud and pmd_free()
Browse files Browse the repository at this point in the history
If pmd_alloc() fails we should only free the prior allocated pud, if
pte_alloc_map() fails, we should free pmd as well.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Sep 22, 2009
1 parent db4e5cb commit 4d04c70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/um/kernel/skas/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
*pte = pte_mkread(*pte);
return 0;

out_pmd:
pud_free(mm, pud);
out_pte:
pmd_free(mm, pmd);
out_pmd:
pud_free(mm, pud);
out:
return -ENOMEM;
}
Expand Down

0 comments on commit 4d04c70

Please sign in to comment.