From 3d14a7bb43d3bff2dad31f0bc928dda275ad86b1 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 24 Sep 2018 15:32:46 +0000 Subject: [PATCH] Ensure that "domain" is initialized when vm_ndomains == 1. Reported by: alc Approved by: re (gjb) --- sys/vm/vm_kern.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index b5915c074ab6..9774e0b4f22d 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -505,8 +505,10 @@ kmem_back(vm_object_t object, vm_offset_t addr, vm_size_t size, int flags) next = roundup2(addr + 1, KVA_QUANTUM); if (next > end || next < start) next = end; - } else + } else { + domain = 0; next = end; + } rv = kmem_back_domain(domain, object, addr, next - addr, flags); if (rv != KERN_SUCCESS) { kmem_unback(object, start, addr - start);