diff options
author | Ian Moffett <ian@osmora.org> | 2024-05-25 17:51:54 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-05-25 17:51:54 -0400 |
commit | bd93d4966c5d78cb4ee2ab84d32890ea1ca77d53 (patch) | |
tree | bb8dc5e2a967679f288c3deed81a56af9a60f0c6 /sys/vm/vm_map.c | |
parent | 32f395140a653e5c7e3e114faeb7314e223f0eea (diff) |
kernel: vm: Make vmobj ref start at zero
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r-- | sys/vm/vm_map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index afe6760..2501e08 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -305,12 +305,12 @@ munmap(void *addr, size_t len) spinlock_acquire(&obj->lock); /* * Drop our ref and try to cleanup. If the refcount - * is > 1, something is still holding it and we can't + * is > 0, something is still holding it and we can't * do much. */ vm_object_unref(obj); vp = obj->vnode; - if (vp != NULL && obj->ref == 1) { + if (vp != NULL && obj->ref == 0) { vp->vmobj = NULL; vm_obj_destroy(obj); } |