Implement resource cleanup for failed allocations during idle thread setup
All checks were successful
Builds / ExectOS (i686, debug) (push) Successful in 45s
Builds / ExectOS (amd64, release) (push) Successful in 47s
Builds / ExectOS (amd64, debug) (push) Successful in 47s
Builds / ExectOS (i686, release) (push) Successful in 45s

This commit is contained in:
2026-06-04 14:36:43 +02:00
parent 53a239958f
commit f680830b53
3 changed files with 17 additions and 4 deletions

View File

@@ -50,5 +50,14 @@ PS::Thread::CreateIdleThread(IN PKPROCESSOR_CONTROL_BLOCK Prcb,
Prcb->IdleThread = &IdleThread->ThreadControlBlock;
/* Initialize the IDLE thread */
return KE::KThread::InitializeIdleThread(IdleProcess, &IdleThread->ThreadControlBlock, Prcb, Stack);
Status = KE::KThread::InitializeIdleThread(IdleProcess, &IdleThread->ThreadControlBlock, Prcb, Stack);
if(Status != STATUS_SUCCESS)
{
/* Failed to initialize the IDLE thread state, free the ETHREAD object and return the status code */
MM::Allocator::FreePool((PVOID)IdleThread);
return Status;
}
/* Return success */
return STATUS_SUCCESS;
}