From 51ad0de583015668df07b278ea4a8076e774b219 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 1 May 2024 21:59:57 -0400 Subject: kernel: vm_vnode: Ref the virtual memory object Signed-off-by: Ian Moffett --- sys/vm/vm_vnode.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/vm') diff --git a/sys/vm/vm_vnode.c b/sys/vm/vm_vnode.c index 707f7b4..e3d95ac 100644 --- a/sys/vm/vm_vnode.c +++ b/sys/vm/vm_vnode.c @@ -72,6 +72,7 @@ vn_pager_io(struct vm_object *obj, off_t off, size_t len, } spinlock_acquire(&obj->lock); + vm_object_ref(obj); dest = PHYS_TO_VIRT(pg->physaddr); /* Attempt to fetch the vnode */ @@ -95,6 +96,7 @@ vn_pager_io(struct vm_object *obj, off_t off, size_t len, goto done; } done: + vm_object_unref(obj); spinlock_release(&obj->lock); return res; } -- cgit v1.2.3