diff mbox

validation: fix memory allocation in odp_synchronizers

Message ID 1427109356-16388-1-git-send-email-maxim.uvarov@linaro.org
State Superseded
Headers show

Commit Message

Maxim Uvarov March 23, 2015, 11:15 a.m. UTC
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>
---
 test/validation/odp_synchronizers.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/test/validation/odp_synchronizers.c b/test/validation/odp_synchronizers.c
index ab9164f..d3539c5 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));