BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / 6217f0db2c8f2513994f4cc773aaa4171a049963 / memory / mmap.c

// Related

Nucleus

Barry Kernel threads + threads share address space 6217f0d (3 years, 1 month ago)
diff --git a/memory/mmap.c b/memory/mmap.c
index 2093bf3..f6e94c7 100644
--- a/memory/mmap.c
+++ b/memory/mmap.c
@@ -26,7 +26,7 @@ mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off)
 				break;
 			region = head;
 		}
-		if (!head && region->end + len >= 0xDFC00000)
+		if (region && region->end + len >= 0xDFC00000)
 			return (void *) -ENOMEM;
 		addr = (void *) region->end;
 	}