From 4e365c5c86abb49349f4851f5c6fb05a5cc2cb3c Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 12 Oct 2023 16:36:45 +0300 Subject: [PATCH] bgpd: Remove redundant check for bgp against NULL bgp_orig is never NULL in the code path, and coverity is angry on this. Let's remove this test at all. Coverity 1566808 Signed-off-by: Donatas Abraitis --- bgpd/bgp_mplsvpn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 138b182718e2..c3e870ee9d55 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1225,8 +1225,9 @@ leak_update(struct bgp *to_bgp, struct bgp_dest *bn, new->extra->vrfleak->parent = bgp_path_info_lock(parent); bgp_dest_lock_node( (struct bgp_dest *)parent->net); - if (bgp_orig) - new->extra->vrfleak->bgp_orig = bgp_lock(bgp_orig); + + new->extra->vrfleak->bgp_orig = bgp_lock(bgp_orig); + if (nexthop_orig) new->extra->vrfleak->nexthop_orig = *nexthop_orig;