diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 5dfca1557fe7..9a139a9f5b19 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2319,7 +2319,8 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); - vm_page_hold(m); + if (m != NULL) + vm_page_hold(m); } } } diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 48a09859f45c..eaee2015cf17 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -1684,7 +1684,8 @@ retry: &pa)) goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); - vm_page_hold(m); + if (m != NULL) + vm_page_hold(m); } } }