From 94b2fa340c970ab4519f167ee557eb2fd3b396ca Mon Sep 17 00:00:00 2001 From: Starnakin Date: Wed, 20 Nov 2024 16:26:01 +0100 Subject: [PATCH] fix: check if zone is not null before explore it --- src/memory/frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory/frame.c b/src/memory/frame.c index 2ac70f8..dd7ade7 100644 --- a/src/memory/frame.c +++ b/src/memory/frame.c @@ -13,7 +13,7 @@ void *alloc_frame(void) struct frame_zone *it = head; while (it && !it->remaining_frames) it = it->next; - if (it->remaining_frames == 0) { + if (!it || it->remaining_frames == 0) { kprintf(KERN_CRIT "No memory zone available (ratio)\n"); return NULL; }