diff options
author | Jere Leppänen <jere.leppanen@nokia.com> | 2024-03-19 15:01:41 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2024-04-16 16:49:46 +0300 |
commit | 8a3b90c47bb68d5647c4b36cc52edef935493d04 (patch) | |
tree | 6129d4259fedec325ed155c26d863dd37956dd5b | |
parent | 1b851cbd54a078f17471c2511fe40cb9da418360 (diff) |
linux-gen: sched: use static array size in schedule_group_create()
With an empty thread mask, thr_tbl[] in schedule_group_create() ends
up being zero size, which is undefined behavior. Fix by using a static
array size.
Fixes GCC undefined sanitizer error:
odp_schedule_basic.c:1922:6: runtime error: variable length array bound evaluates to non-positive value 0
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
-rw-r--r-- | platform/linux-generic/odp_schedule_basic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 52040c33e..69fbf7d6f 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -1919,7 +1919,7 @@ static odp_schedule_group_t schedule_group_create(const char *name, return ODP_SCHED_GROUP_INVALID; } - int thr_tbl[count]; + int thr_tbl[ODP_THREAD_COUNT_MAX]; if (count && threads_from_mask(thr_tbl, count, mask)) return ODP_SCHED_GROUP_INVALID; |