diff options
author | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-03-23 16:03:21 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-03-24 19:34:05 +0300 |
commit | 2152edd7b366d0489c7228bcfbc4b24a04ba2d2b (patch) | |
tree | 874554edec328a9968b270311bf3376a73a6bae9 /test | |
parent | 27ba2e12e711a88787a849fa0a340cb494afe01b (diff) |
validation: fix memory allocation in odp_synchronizers
odp_synchronizers should not reverve memory with PROC flag,
i.e. with requesting shared memory object. Without that
fix there might be seg. faults if prior shared memory object
was created with prior runs.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/validation/odp_synchronizers.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/validation/odp_synchronizers.c b/test/validation/odp_synchronizers.c index ab9164faa..d3539c50e 100644 --- a/test/validation/odp_synchronizers.c +++ b/test/validation/odp_synchronizers.c @@ -1052,7 +1052,12 @@ int tests_global_init(void) global_shm = odp_shm_reserve(GLOBAL_SHM_NAME, sizeof(global_shared_mem_t), 64, - ODP_SHM_SW_ONLY | ODP_SHM_PROC); + ODP_SHM_SW_ONLY); + if (ODP_SHM_INVALID == global_shm) { + fprintf(stderr, "Unable reserve memory for global_shm\n"); + return -1; + } + global_mem = odp_shm_addr(global_shm); memset(global_mem, 0, sizeof(global_shared_mem_t)); |