diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 4947353d61..5513acb043 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -927,6 +927,9 @@ static int _schedule(odp_queue_t *from, odp_event_t ev[], int num_evts) } cpu_id = odp_cpu_id(); + if (odp_unlikely(cpu_id < 0)) + return 0; + /* Scan our schedq list from beginning to end */ for (i = 0; i < ts->num_schedq; i++) { sched_queue_t *schedq = ts->schedq_list[i]; diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index bf5845d245..7baaa6c2c6 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -9,16 +9,18 @@ #include +#include +#include +#include #include #include + #include #include #include #include #include #include -#include -#include #include #include @@ -439,6 +441,9 @@ uint64_t odp_cpu_hz(void) { int id = odp_cpu_id(); + if (odp_unlikely(id < 0)) + return -1; + if (odp_global_ro.system_info.cpu_hz_static) return cpu_hz_static(id); return cpu_hz_current(id);