diff options
-rw-r--r-- | sys/vm/vm_physmem.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/vm/vm_physmem.c b/sys/vm/vm_physmem.c index f8caf9a..0bd2d54 100644 --- a/sys/vm/vm_physmem.c +++ b/sys/vm/vm_physmem.c @@ -32,6 +32,7 @@ #include <sys/limine.h> #include <sys/syslog.h> #include <sys/spinlock.h> +#include <sys/panic.h> #include <vm/physmem.h> #include <vm/vm.h> #include <string.h> @@ -194,6 +195,10 @@ vm_alloc_frame(size_t count) ret = __vm_alloc_frame(count); } + if (ret == 0) { + panic("out of memory\n"); + } + pages_used += count; pages_free -= count; spinlock_release(&lock); |