summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_evpn_mh.c
diff options
context:
space:
mode:
authoranlan_cs <vic.lan@pica8.com>2022-03-19 06:04:43 +0100
committeranlan_cs <vic.lan@pica8.com>2022-03-19 06:45:14 +0100
commit2a778afe9d047a35d63aee0aa78aa6634ad52d20 (patch)
tree835e9bd17a918fcec9c920e17a597ec847ff87a9 /zebra/zebra_evpn_mh.c
parentMerge pull request #10817 from kuldeepkash/micronet_fixes (diff)
downloadfrr-2a778afe9d047a35d63aee0aa78aa6634ad52d20.tar.xz
frr-2a778afe9d047a35d63aee0aa78aa6634ad52d20.zip
zebra: remove check returning value of RB_INSERT()
Since the `RB_INSERT()` is called after not found in RB tree, it MUST be ok and and return zero. The check of returning value of `RB_INSERT()` is redundant, just remove them. Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'zebra/zebra_evpn_mh.c')
-rw-r--r--zebra/zebra_evpn_mh.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c
index 9099c066b..02eda4a43 100644
--- a/zebra/zebra_evpn_mh.c
+++ b/zebra/zebra_evpn_mh.c
@@ -113,10 +113,7 @@ static struct zebra_evpn_es_evi *zebra_evpn_es_evi_new(struct zebra_evpn_es *es,
es_evi->zevpn = zevpn;
/* insert into the EVPN-ESI rb tree */
- if (RB_INSERT(zebra_es_evi_rb_head, &zevpn->es_evi_rb_tree, es_evi)) {
- XFREE(MTYPE_ZES_EVI, es_evi);
- return NULL;
- }
+ RB_INSERT(zebra_es_evi_rb_head, &zevpn->es_evi_rb_tree, es_evi);
/* add to the ES's VNI list */
listnode_init(&es_evi->es_listnode, es_evi);
@@ -1776,10 +1773,7 @@ static struct zebra_evpn_es *zebra_evpn_es_new(const esi_t *esi)
esi_to_str(&es->esi, es->esi_str, sizeof(es->esi_str));
/* Add to rb_tree */
- if (RB_INSERT(zebra_es_rb_head, &zmh_info->es_rb_tree, es)) {
- XFREE(MTYPE_ZES, es);
- return NULL;
- }
+ RB_INSERT(zebra_es_rb_head, &zmh_info->es_rb_tree, es);
/* Initialise the ES-EVI list */
es->es_evi_list = list_new();