aboutsummaryrefslogtreecommitdiff
path: root/test/validation/api/scheduler/scheduler.c
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2019-02-19 13:13:04 +0200
committerMatias Elo <matias.elo@nokia.com>2019-02-26 11:13:32 +0200
commitd9fb340f78366750b7b519a1e838f73672428870 (patch)
tree17786a0dc6de51beeb0afa27fa1ed7a47a57de7c /test/validation/api/scheduler/scheduler.c
parent60d0a8cef06f7d5c2dcfceea69a6339613315654 (diff)
test: check odp_shm_reserve() return value
Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'test/validation/api/scheduler/scheduler.c')
-rw-r--r--test/validation/api/scheduler/scheduler.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c
index c128580d6..b7128c1f0 100644
--- a/test/validation/api/scheduler/scheduler.c
+++ b/test/validation/api/scheduler/scheduler.c
@@ -2010,6 +2010,11 @@ static int scheduler_suite_init(void)
shm = odp_shm_reserve(GLOBALS_SHM_NAME,
sizeof(test_globals_t), ODP_CACHE_LINE_SIZE, 0);
+ if (shm == ODP_SHM_INVALID) {
+ printf("Shared memory reserve failed (globals).\n");
+ return -1;
+ }
+
globals = odp_shm_addr(shm);
if (!globals) {
@@ -2027,6 +2032,12 @@ static int scheduler_suite_init(void)
shm = odp_shm_reserve(SHM_THR_ARGS_NAME, sizeof(thread_args_t),
ODP_CACHE_LINE_SIZE, 0);
+
+ if (shm == ODP_SHM_INVALID) {
+ printf("Shared memory reserve failed (args).\n");
+ return -1;
+ }
+
args = odp_shm_addr(shm);
if (!args) {