DragonFlyBSD Kernel Audit
DF-0951 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c
--- a/sys/vm/vm_zone.c
+++ b/sys/vm/vm_zone.c
@@ -380,7 +380,9 @@
 		z->zkva = kmem_alloc_pageable(kernel_map, totsize,
 					      VM_SUBSYS_ZALLOC);
 		if (z->zkva == 0) {
+			lwkt_gettoken(&vm_token);
 			LIST_REMOVE(z, zlink);
+			lwkt_reltoken(&vm_token);
 			return 0;
 		}