]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ppc64: bugfix for hugepage support
authorAndrew Morton <akpm@osdl.org>
Thu, 1 Apr 2004 05:50:22 +0000 (21:50 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 1 Apr 2004 05:50:22 +0000 (21:50 -0800)
From: David Gibson <david@gibson.dropbear.id.au>

Due to a misunderstanding of pmd_offset() the PPC64 hugepage code could end
up looking at bogus pages as if they were PMD pages.

arch/ppc64/mm/hugetlbpage.c

index a8eb6845f34da83e0f2c5dc56dce9426294d5de8..1f620734b3045b17f28200b5654766b19a42c8c2 100644 (file)
@@ -190,6 +190,9 @@ static hugepte_t *hugepte_offset(struct mm_struct *mm, unsigned long addr)
        BUG_ON(!in_hugepage_area(mm->context, addr));
 
        pgd = pgd_offset(mm, addr);
+       if (pgd_none(*pgd))
+               return NULL;
+
        pmd = pmd_offset(pgd, addr);
 
        /* We shouldn't find a (normal) PTE page pointer here */