vm_page_grab_valid(): clear *mp in case of pager denying page allocation

Same as it is done in other error return cases.  Callers depend on error
case returning NULL, e.g. vm_imgact_hold_page().

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37719
This commit is contained in:
Konstantin Belousov 2022-12-17 02:12:14 +02:00
parent f176fe8e7f
commit 3249449190

View File

@ -4713,8 +4713,10 @@ vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int al
*mp = NULL;
return (VM_PAGER_FAIL);
} else if ((m = vm_page_alloc(object, pindex, pflags)) == NULL) {
if (!vm_pager_can_alloc_page(object, pindex))
if (!vm_pager_can_alloc_page(object, pindex)) {
*mp = NULL;
return (VM_PAGER_AGAIN);
}
goto retrylookup;
}