[API-NEXT] linux-generic: shm: return error if find shm fails

Message ID 1481743286-19497-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Dec. 14, 2016, 7:21 p.m.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
 platform/linux-generic/odp_shared_memory.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.7.1.250.gff4ea60

Patch

diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c
index ba32dee..7148eed 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -73,6 +73,8 @@  odp_shm_t odp_shm_import(const char *remote_name,
 
 	ret =  _odp_ishm_find_exported(remote_name, (pid_t)odp_inst,
 				       local_name);
+	if (ret < 0)
+		return ODP_SHM_INVALID;
 
 	return to_handle(ret);
 }