diff options
author | kib <kib@FreeBSD.org> | 2014-05-06 12:20:07 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-05-06 12:20:07 +0000 |
commit | 68fab2508087e21af8f980acb74995c49794a872 (patch) | |
tree | f8c53971c66db545f51e3d3d640a333f99193ce0 | |
parent | cab8f4561e24d722e9e9b500434936a03a8c3ca7 (diff) | |
download | FreeBSD-src-68fab2508087e21af8f980acb74995c49794a872.zip FreeBSD-src-68fab2508087e21af8f980acb74995c49794a872.tar.gz |
MFC r265100:
Fix the comparision for the end of range in vm_phys_fictitious_reg_range().
-rw-r--r-- | sys/vm/vm_phys.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index a79a5f6..b354a8d 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -552,7 +552,9 @@ vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, #ifdef VM_PHYSSEG_DENSE pi = atop(start); - if (pi >= first_page && atop(end) < vm_page_array_size) { + if (pi >= first_page && pi < vm_page_array_size + first_page) { + if (atop(end) >= vm_page_array_size + first_page) + return (EINVAL); fp = &vm_page_array[pi - first_page]; malloced = FALSE; } else |