]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: ctx has to be non NULL at this point
authorDonald Sharp <sharpd@nvidia.com>
Fri, 21 Apr 2023 12:54:51 +0000 (08:54 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 21 Apr 2023 12:54:51 +0000 (08:54 -0400)
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 <sharpd@nvidia.com>
zebra/zebra_dplane.c

index e821572c5d7b18f88b8b000cd13864b5600850dd..f6c1fdd78e43a9f6a24744f28d60d286c9278610 100644 (file)
@@ -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;