From ecb846048238b2e7442331af9aebdbfeb0ab37a0 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 10 Sep 2023 09:55:24 -0400 Subject: [PATCH] bgpd: bgp_afi_node_get teach coverity about unlocking The pdest pointer is locked by the bgp_node_get so unlocking it should be fine and it should still exist. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 3ef495cd5c..8c8087a2f5 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -138,7 +138,9 @@ struct bgp_dest *bgp_afi_node_get(struct bgp_table *table, afi_t afi, bgp_dest_set_bgp_table_info( pdest, bgp_table_init(table->bgp, afi, safi)); else - bgp_dest_unlock_node(pdest); + pdest = bgp_dest_unlock_node(pdest); + + assert(pdest); table = bgp_dest_get_bgp_table_info(pdest); }