Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d04c707 authored by Roel Kluin's avatar Roel Kluin Committed by Linus Torvalds
Browse files

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent db4e5cbe
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
}