From 1a5434245428da68e3d96afe4b9f6ebe58215e9b Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 12 Oct 2022 18:38:18 +0200 Subject: [PATCH] Sanity check --- kernel/src/thread/Scheduler.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/src/thread/Scheduler.cpp b/kernel/src/thread/Scheduler.cpp index 8d8a85c6..d0fad993 100644 --- a/kernel/src/thread/Scheduler.cpp +++ b/kernel/src/thread/Scheduler.cpp @@ -130,12 +130,7 @@ void Scheduler::load_user_task(const char* filename) ELFImage* image = ELFLoader::load_elf_from_filesystem( filename); // FIXME: TOCTOU? Right now, impossible, since interrupts are disabled and SMP is not a thing. But in // the future, it might be possible. - if (!image) - { - kerrorln("Failed to load %s from initrd", filename); - delete new_task; - return; - } + ASSERT(image); new_task->user_task = true; new_task->regs.rip = image->entry; new_task->image = image;