From 4ab8ab9285774d0d22a7350fead176c630d87454 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 8 Oct 2007 20:09:53 +0000 Subject: [PATCH] Do not dereference NULL pointer. Reported by: Peter Holm Reviewed by: alc Approved by: re (kensmith) --- sys/vm/vm_fault.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index b26972e96f81..49a4077046a8 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -431,14 +431,13 @@ RetryFault:; if (!vm_page_count_severe()) { fs.m = vm_page_alloc(fs.object, fs.pindex, (fs.vp || fs.object->backing_object)? VM_ALLOC_NORMAL: VM_ALLOC_ZERO); - if ((fs.m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) - break; } if (fs.m == NULL) { unlock_and_deallocate(&fs); VM_WAITPFAULT; goto RetryFault; - } + } else if ((fs.m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) + break; } readrest: