summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_obj.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vm_obj.c b/sys/vm/vm_obj.c
index 6dbe777..b501c6b 100644
--- a/sys/vm/vm_obj.c
+++ b/sys/vm/vm_obj.c
@@ -74,13 +74,13 @@ vm_obj_destroy(struct vm_object *obj)
{
struct vnode *vp = obj->vnode;
- if (vp->vmobj != NULL)
- vp->vmobj = NULL;
-
/* Check the ref count */
- if (obj->ref > 1)
+ if (obj->ref > 0)
return -EBUSY;
+ if (vp != NULL)
+ vp->vmobj = NULL;
+
dynfree(obj);
--obj_count;
return 0;