fix (scheduler): added chunk NULL reference check when resolving processes

This commit is contained in:
antifallobst 2023-03-11 10:37:44 +01:00
parent b5e2945165
commit 606e4b619c
1 changed files with 3 additions and 0 deletions

View File

@ -255,6 +255,9 @@ process_T* scheduler_get_process(pid_t pid) {
uint32_t index_in_chunk = pid % SCHEDULER_PROCESS_CHUNK_SIZE; uint32_t index_in_chunk = pid % SCHEDULER_PROCESS_CHUNK_SIZE;
scheduler_processes_chunk_T* chunk = g_scheduler.processes; scheduler_processes_chunk_T* chunk = g_scheduler.processes;
if (chunk == NULL) {
return NULL;
}
for (uint32_t i = 0; i < num_chunks; i++) { for (uint32_t i = 0; i < num_chunks; i++) {
chunk = chunk->next; chunk = chunk->next;