From d7c9666e060ecbd31f5fa9b384c2a56118bbb279 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 21 May 2023 19:55:20 -0400 Subject: [PATCH] zebra: Fix paths that have already de-refed ctx There is no path in some functions where the ctx has not already been de-refed. As such no need to test for it's existence. Signed-off-by: Donald Sharp --- zebra/zebra_dplane.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 3653f71527..a768c33a30 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -3799,8 +3799,7 @@ tc_qdisc_update_internal(enum dplane_op_e op, } else { atomic_fetch_add_explicit(&zdplane_info.dg_tcs_errors, 1, memory_order_relaxed); - if (ctx) - dplane_ctx_free(&ctx); + dplane_ctx_free(&ctx); } return result; @@ -3830,8 +3829,7 @@ tc_class_update_internal(enum dplane_op_e op, struct zebra_tc_class *class) } else { atomic_fetch_add_explicit(&zdplane_info.dg_tcs_errors, 1, memory_order_relaxed); - if (ctx) - dplane_ctx_free(&ctx); + dplane_ctx_free(&ctx); } return result; @@ -3861,8 +3859,7 @@ tc_filter_update_internal(enum dplane_op_e op, struct zebra_tc_filter *filter) } else { atomic_fetch_add_explicit(&zdplane_info.dg_tcs_errors, 1, memory_order_relaxed); - if (ctx) - dplane_ctx_free(&ctx); + dplane_ctx_free(&ctx); } return result; @@ -4230,8 +4227,7 @@ done: else { atomic_fetch_add_explicit(&zdplane_info.dg_lsp_errors, 1, memory_order_relaxed); - if (ctx) - dplane_ctx_free(&ctx); + dplane_ctx_free(&ctx); } return result; } -- 2.39.5