From: Roel Kluin Date: Tue, 22 Sep 2009 00:04:11 +0000 (-0700) Subject: uml: fix order of pud and pmd_free() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4d04c70754eec6d0fd342a5bc3f684db69cc2226;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git uml: fix order of pud and pmd_free() 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 Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c index 0cd9a7a05e77..8bfd1e905812 100644 --- a/arch/um/kernel/skas/mmu.c +++ b/arch/um/kernel/skas/mmu.c @@ -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; }