aboutsummaryrefslogtreecommitdiff
path: root/helper/hashtable.c
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2017-05-05 15:49:56 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-05-11 18:49:48 +0300
commitbd583923b29e5dddc4d1b9c6d0e0a513edb69496 (patch)
tree9add76ee283e2f046d9eaf69b00101ee0749d0e9 /helper/hashtable.c
parent79ba737a404d2833ad33d8f84ed6ce82c9a8c18e (diff)
helper: tables: avoid invalid odp_shm_addr() calls
odp_shm_lookup() return value can be used to detect name conflicts. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper/hashtable.c')
-rw-r--r--helper/hashtable.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/helper/hashtable.c b/helper/hashtable.c
index 9d4114445..f26b18b27 100644
--- a/helper/hashtable.c
+++ b/helper/hashtable.c
@@ -76,8 +76,7 @@ odph_table_t odph_hash_table_create(const char *name, uint32_t capacity,
ODPH_DBG("create para input error!\n");
return NULL;
}
- tbl = (odph_hash_table_imp *)odp_shm_addr(odp_shm_lookup(name));
- if (tbl != NULL) {
+ if (odp_shm_lookup(name) != ODP_SHM_INVALID) {
ODPH_DBG("name already exist\n");
return NULL;
}