]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: ctx is dereferenced in every path 4330/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 11 May 2019 12:39:54 +0000 (08:39 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 11 May 2019 12:39:54 +0000 (08:39 -0400)
No need to check for non-null ctx at this point in the
function as that it has already been derefed.

Signed-off-by: donald Sharp ,sahrpd@cumulusnetworks.com>
zebra/zebra_dplane.c

index ae52762c5a8b2690b07712be97bef5cffc97c8e2..6fc62147c815c6c9ac4663bf1b08c160bdb6f3fa 100644 (file)
@@ -1574,8 +1574,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;
@@ -1609,8 +1608,7 @@ done:
        else {
                atomic_fetch_add_explicit(&zdplane_info.dg_pw_errors, 1,
                                          memory_order_relaxed);
-               if (ctx)
-                       dplane_ctx_free(&ctx);
+               dplane_ctx_free(&ctx);
        }
 
        return result;
@@ -1737,8 +1735,7 @@ static enum zebra_dplane_result intf_addr_update_internal(
                /* Error counter */
                atomic_fetch_add_explicit(&zdplane_info.dg_intf_addr_errors,
                                          1, memory_order_relaxed);
-               if (ctx)
-                       dplane_ctx_free(&ctx);
+               dplane_ctx_free(&ctx);
        }
 
        return result;