DragonFlyBSD Kernel Audit
DF-0917 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/vfs/fuse/fuse_device.c b/sys/vfs/fuse/fuse_device.c
--- a/sys/vfs/fuse/fuse_device.c
+++ b/sys/vfs/fuse/fuse_device.c
@@ -146,6 +146,7 @@
 		}
 	}
 	TAILQ_REMOVE(&fmp->request_head, fip, request_entry);
+	refcount_acquire(&fip->refcnt);
 	mtx_unlock(&fmp->ipc_lock);
 
 	fuse_dbgipc(fip, 0, "");
@@ -158,6 +159,7 @@
 	if (atomic_swap_int(&fip->sent, 1) == -1)
 		wakeup(fip);
 
+	fuse_ipc_put(fip);
 	return error;
 }
 
@@ -191,6 +193,7 @@
 	TAILQ_FOREACH(fip, &fmp->reply_head, reply_entry) {
 		if (fip->unique == ohd->unique) {
 			TAILQ_REMOVE(&fmp->reply_head, fip, reply_entry);
+			refcount_acquire(&fip->refcnt);
 			break;
 		}
 	}
@@ -219,6 +222,7 @@
 	if (fuse_ipc_test_and_set_replied(fip))
 		wakeup(fip);
 
+	fuse_ipc_put(fip);
 	return error;
 }