summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index e5209b5..f6ce86c 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -310,7 +310,8 @@ vmspace_free(struct vmspace *vm)
if (vm->vm_refcnt == 0)
panic("vmspace_free: attempt to free already freed vmspace");
- if (--vm->vm_refcnt == 0 && vm->vm_exitingcnt == 0)
+ --vm->vm_refcnt;
+ if (vm->vm_refcnt == 0 && vm->vm_exitingcnt == 0)
vmspace_dofree(vm);
}
@@ -334,7 +335,8 @@ vmspace_exitfree(struct proc *p)
* The last wait on the exiting child's vmspace will clean up
* the remainder of the vmspace.
*/
- if (--vm->vm_exitingcnt == 0 && vm->vm_refcnt == 0)
+ --vm->vm_exitingcnt;
+ if (vm->vm_refcnt == 0 && vm->vm_exitingcnt == 0)
vmspace_dofree(vm);
}
OpenPOWER on IntegriCloud