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 <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-04-21 08:54:51 -04:00
parent 4dbef8567b
commit 6f99cfcd89

View 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;