aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_kern.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2019-03-29 16:53:46 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2019-03-29 16:53:46 +0000
commit9f701172635d755151f24e15e78c357d3378bd09 (patch)
treedf43e1f78aaff347ac23e134cf54b90c97472c5b /sys/vm/vm_kern.c
parentbe09e82abbf575f9f4ac7b1de620e77924816d57 (diff)
downloadsrc-9f701172635d755151f24e15e78c357d3378bd09.tar.gz
src-9f701172635d755151f24e15e78c357d3378bd09.zip
Notes
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r--sys/vm/vm_kern.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 05b3669449eb..ac87a40a3b81 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -641,7 +641,8 @@ kmap_alloc_wait(vm_map_t map, vm_size_t size)
* to lock out sleepers/wakers.
*/
vm_map_lock(map);
- if (vm_map_findspace(map, vm_map_min(map), size, &addr) == 0)
+ addr = vm_map_findspace(map, vm_map_min(map), size);
+ if (addr + size <= vm_map_max(map))
break;
/* no space now; see if we can ever get space */
if (vm_map_max(map) - vm_map_min(map) < size) {