misc: fix static analysis warnings 73/28373/1
authorDave Barach <dave@barachs.net>
Thu, 2 Apr 2020 14:44:09 +0000 (10:44 -0400)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Thu, 13 Aug 2020 10:39:40 +0000 (10:39 +0000)
One actual bugfix.

Type: fix
Ticket: VPP-1837

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Icef25167f97a70cc795c0a481174de319ed79ad5
(cherry picked from commit c35f3e835b4078fedabc1ff5013bc4727f533e16)

src/svm/svm.c
src/vat/api_format.c

index 4211219..a74b50f 100644 (file)
@@ -103,7 +103,7 @@ region_lock (svm_region_t * rp, int tag)
   rp->mutex_owner_pid = getpid ();
   rp->mutex_owner_tag = tag;
 #endif
-  ASSERT (nheld < MAXLOCK);
+  ASSERT (nheld < MAXLOCK);    //NOSONAR
   /*
    * Keep score of held mutexes so we can try to exit
    * cleanly if the world comes to an end at the worst possible
@@ -770,7 +770,7 @@ svm_map_region (svm_map_region_args_t * a)
       return ((void *) rp);
 
     }
-  return 0;                    /* NOTREACHED */
+  return 0;                    /* NOTREACHED *///NOSONAR
 }
 
 static void
@@ -779,7 +779,7 @@ svm_mutex_cleanup (void)
   int i;
   for (i = 0; i < nheld; i++)
     {
-      pthread_mutex_unlock (mutexes_held[i]);
+      pthread_mutex_unlock (mutexes_held[i]);  //NOSONAR
     }
 }
 
index 1230ab5..c82c367 100644 (file)
@@ -18741,7 +18741,7 @@ vl_api_mpls_fib_path_json_print (vat_json_node_t * node,
       clib_memcpy (&ip4, &fp->nh.address.ip4, sizeof (ip4));
       vat_json_object_add_ip4 (node, "next_hop", ip4);
     }
-  else if (fp->proto == FIB_API_PATH_NH_PROTO_IP4)
+  else if (fp->proto == FIB_API_PATH_NH_PROTO_IP6)
     {
       clib_memcpy (&ip6, &fp->nh.address.ip6, sizeof (ip6));
       vat_json_object_add_ip6 (node, "next_hop", ip6);