1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

Check for pte being NULL in return from pmap_pte_pde- unlikely or

even impossible, but it's better ot have a panic and a quiesced
gcc4.2.
This commit is contained in:
Matt Jacob 2007-06-17 04:27:45 +00:00
parent 27705ac087
commit 7fc02735f4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170867

View File

@ -1645,6 +1645,9 @@ pmap_collect(pmap_t locked_pmap, struct vpgqueues *vpq)
continue;
pmap->pm_stats.resident_count--;
pte = pmap_pte_pde(pmap, va, &ptepde);
if (pte == NULL) {
panic("null pte in pmap_collect");
}
tpte = pte_load_clear(pte);
KASSERT((tpte & PG_W) == 0,
("pmap_collect: wired pte %#lx", tpte));
@ -2060,6 +2063,9 @@ pmap_remove_all(vm_page_t m)
PMAP_LOCK(pmap);
pmap->pm_stats.resident_count--;
pte = pmap_pte_pde(pmap, pv->pv_va, &ptepde);
if (pte == NULL) {
panic("null pte in pmap_remove_all");
}
tpte = pte_load_clear(pte);
if (tpte & PG_W)
pmap->pm_stats.wired_count--;