Add missing checks of return value

This commit is contained in:
Rodrigo Arias 2023-02-27 12:29:57 +01:00 committed by Rodrigo Arias Mallo
parent a0a70b1ffc
commit dc2a016c6b
2 changed files with 12 additions and 3 deletions

View File

@ -35,10 +35,16 @@ pre_thread_execute(struct emu *emu, struct thread *th)
dbg("thread %d runs in %s", th->tid, cpu->name);
/* First set the CPU in the thread */
thread_set_cpu(th, cpu);
if (thread_set_cpu(th, cpu) != 0) {
err("thread_set_cpu failed");
return -1;
}
/* Then set the thread to running state */
thread_set_state(th, TH_ST_RUNNING);
if (thread_set_state(th, TH_ST_RUNNING) != 0) {
err("thread_set_state failed");
return -1;
}
/* And then add the thread to the CPU, so tracking channels see the
* updated thread state */

View File

@ -543,7 +543,10 @@ system_connect(struct system *sys, struct bay *bay, struct recorder *rec)
return -1;
}
cpu_add_to_pcf_type(cpu, affinity_type);
if (cpu_add_to_pcf_type(cpu, affinity_type) == NULL) {
err("cpu_add_to_pcf_type failed for cpu '%s'", cpu->name);
return -1;
}
}
return 0;