A loop in pmap_remove() should use TAILQ_FOREACH_SAFE(), not

TAILQ_FOREACH(), because the loop deletes elements from the list.

Reviewed by:	marcel@
This commit is contained in:
alc 2004-07-15 03:20:00 +00:00
parent 47308fc5b0
commit dc267d738b

View File

@ -1331,7 +1331,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
pmap_t oldpmap;
vm_offset_t va;
pv_entry_t pv;
pv_entry_t npv, pv;
struct ia64_lpte *pte;
if (pmap == NULL)
@ -1354,7 +1354,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
}
if (pmap->pm_stats.resident_count < ((eva - sva) >> PAGE_SHIFT)) {
TAILQ_FOREACH(pv, &pmap->pm_pvlist, pv_plist) {
TAILQ_FOREACH_SAFE(pv, &pmap->pm_pvlist, pv_plist, npv) {
va = pv->pv_va;
if (va >= sva && va < eva) {
pte = pmap_find_vhpt(va);