fix non-void function with the possibility of no return statement
Signed-off-by: Mike Holmes <[email protected]>
---
helper/cuckootable.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/helper/cuckootable.c b/helper/cuckootable.c
index 91a73b4..1327a40 100644
--- a/helper/cuckootable.c
+++ b/helper/cuckootable.c
@@ -171,10 +171,12 @@ odph_cuckoo_table_lookup(const char *name)
tbl = (odph_cuckoo_table_impl *)odp_shm_addr(odp_shm_lookup(name));
if (
- tbl != NULL &&
+ !(tbl != NULL &&
tbl->magicword == ODPH_CUCKOO_TABLE_MAGIC_WORD &&
- strcmp(tbl->name, name) == 0)
- return (odph_table_t)tbl;
+ strcmp(tbl->name, name) == 0))
+ tbl = NULL;
+
+ return (odph_table_t)tbl;
}
odph_table_t
@@ -355,6 +357,8 @@ odph_cuckoo_table_destroy(odph_table_t tbl)
/* free impl */
odp_shm_free(odp_shm_lookup(impl->name));
+
+ return 0;
}
static uint32_t hash(const odph_cuckoo_table_impl *h, const void *key)
--
2.7.4