From b7dd15242cc5e616e140369f598bed4527a6e838 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 10 Sep 2023 09:32:29 -0400 Subject: [PATCH] bgpd: ensure delete_all_vni_routes does not free dest dest is locked by the table walk. ensure that coverity understands this. Signed-off-by: Donald Sharp --- bgpd/bgp_evpn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 9bc6c508dc..c97a53bf13 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -2649,7 +2649,9 @@ static void delete_all_vni_routes(struct bgp *bgp, struct bgpevpn *vpn) (pi != NULL) && (nextpi = pi->next, 1); pi = nextpi) { bgp_evpn_remote_ip_hash_del(vpn, pi); bgp_path_info_delete(dest, pi); - bgp_path_info_reap(dest, pi); + dest = bgp_path_info_reap(dest, pi); + + assert(dest); } } @@ -2658,7 +2660,9 @@ static void delete_all_vni_routes(struct bgp *bgp, struct bgpevpn *vpn) for (pi = bgp_dest_get_bgp_path_info(dest); (pi != NULL) && (nextpi = pi->next, 1); pi = nextpi) { bgp_path_info_delete(dest, pi); - bgp_path_info_reap(dest, pi); + dest = bgp_path_info_reap(dest, pi); + + assert(dest); } } } -- 2.39.5