patch-2.4.27 linux-2.4.27/arch/ia64/mm/hugetlbpage.c

Next file: linux-2.4.27/arch/m68k/ifpsp060/iskeleton.S
Previous file: linux-2.4.27/arch/ia64/kernel/unwind.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.26/arch/ia64/mm/hugetlbpage.c linux-2.4.27/arch/ia64/mm/hugetlbpage.c
@@ -73,8 +73,12 @@
 	pte_t *pte = NULL;
 
 	pgd = pgd_offset(mm, taddr);
-	pmd = pmd_offset(pgd, taddr);
-	pte = pte_offset(pmd, taddr);
+	if (pgd_present(*pgd)) {
+		pmd = pmd_offset(pgd, taddr);
+		if (pmd_present(*pmd))
+			pte = pte_offset(pmd, taddr);
+	}
+
 	return pte;
 }
 
@@ -269,7 +273,7 @@
 
 	for (address = start; address < end; address += HPAGE_SIZE) {
 		pte = huge_pte_offset(mm, address);
-		if (pte_none(*pte))
+		if (!pte || pte_none(*pte))
 			continue;
 		page = pte_page(*pte);
 		huge_page_release(page);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)