diff options
author | 2018-01-18 12:44:50 -0500 | |
---|---|---|
committer | 2018-01-18 18:52:46 -0500 | |
commit | 7f5bec647c9dc743c015d461d040e63a77fd0a08 (patch) | |
tree | 5feb7e1555be7c93d2d1c1ca1ad9fdfda77e7759 /src/vppinfra/hash.h | |
parent | ec941ecb86bbce237b1c3d6c20ab17b4471d7cff (diff) |
Sub-Interface deletion not cleanup hash's properly (VPP-1136)
On deleting sub-interfaces, functions vnet_delete_sub_interface()
and vnet_delete_hw_interface() are not cleaning up sub-interface
related hash tables and memory properly.
Change-Id: I17c7c4b2078c062c77bfe48889beb677610035ca
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vppinfra/hash.h')
-rw-r--r-- | src/vppinfra/hash.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vppinfra/hash.h b/src/vppinfra/hash.h index 6206dd2a486..21986ea774c 100644 --- a/src/vppinfra/hash.h +++ b/src/vppinfra/hash.h @@ -294,10 +294,12 @@ always_inline void hash_unset_mem_free (uword ** h, void *key) { hash_pair_t *hp = hash_get_pair_mem (*h, key); - ASSERT (hp); - key = uword_to_pointer (hp->key, void *); - hash_unset_mem (*h, key); - clib_mem_free (key); + if (PREDICT_TRUE (hp != NULL)) + { + key = uword_to_pointer (hp->key, void *); + hash_unset_mem (*h, key); + clib_mem_free (key); + } } /* internal routine to free a hash table */ |