uml: fix order of pud and pmd_free()
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 22 Sep 2009 00:04:11 +0000 (17:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Sep 2009 14:17:45 +0000 (07:17 -0700)
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>
arch/um/kernel/skas/mmu.c

index 0cd9a7a05e777bf79447af2338a9f6aaa784281d..8bfd1e90581225eb0e19fada92611399d2a1d4c8 100644 (file)
@@ -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;
 }