fix (scheduler): added chunk NULL reference check when resolving processes
This commit is contained in:
parent
b5e2945165
commit
606e4b619c
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue