From 6f99cfcd897fa63f24a9e9fcf9999aaf7ad76e69 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 21 Apr 2023 08:54:51 -0400 Subject: [PATCH] zebra: ctx has to be non NULL at this point Remove the pointer check for ctx. At this point in the function it has to be non null since we deref'ed it. Additionally the alloc function that creates it cannot fail. Signed-off-by: Donald Sharp --- zebra/zebra_dplane.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index e821572c5d..f6c1fdd78e 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -5380,8 +5380,7 @@ dplane_gre_set(struct interface *ifp, struct interface *ifp_link, atomic_fetch_add_explicit( &zdplane_info.dg_gre_set_errors, 1, memory_order_relaxed); - if (ctx) - dplane_ctx_free(&ctx); + dplane_ctx_free(&ctx); result = ZEBRA_DPLANE_REQUEST_FAILURE; } return result;