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

Commit 02b0ccef authored by Adam Litke's avatar Adam Litke Committed by Linus Torvalds
Browse files

[PATCH] hugetlb: check p?d_present in huge_pte_offset()



For demand faulting, we cannot assume that the page tables will be
populated.  Do what the rest of the architectures do and test p?d_present()
while walking down the page table.

Signed-off-by: default avatarAdam Litke <agl@us.ibm.com>
Cc: <linux-mm@kvack.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7bf07f3d
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -46,8 +46,11 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
	pmd_t *pmd = NULL;
	pmd_t *pmd = NULL;


	pgd = pgd_offset(mm, addr);
	pgd = pgd_offset(mm, addr);
	if (pgd_present(*pgd)) {
		pud = pud_offset(pgd, addr);
		pud = pud_offset(pgd, addr);
		if (pud_present(*pud))
			pmd = pmd_offset(pud, addr);
			pmd = pmd_offset(pud, addr);
	}
	return (pte_t *) pmd;
	return (pte_t *) pmd;
}
}