session/vcl: fix coverity warnings 66/17766/2
authorFlorin Coras <fcoras@cisco.com>
Fri, 22 Feb 2019 04:04:15 +0000 (20:04 -0800)
committerDamjan Marion <dmarion@me.com>
Fri, 22 Feb 2019 10:55:08 +0000 (10:55 +0000)
Change-Id: I9b0e6d65255e516cf5bf18757d4769176ef76e92
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vcl/ldp.c
src/vcl/vcl_locked.c
src/vnet/session-apps/http_server.c

index e0fb935..2468bcc 100644 (file)
@@ -646,6 +646,9 @@ ldp_select_libc_map_merge (clib_bitmap_t * result, fd_set * __restrict libcb)
 {
   uword fd;
 
+  if (!libcb)
+    return;
+
   /* *INDENT-OFF* */
   clib_bitmap_foreach (fd, result, ({
     FD_SET ((int)fd, libcb);
@@ -728,7 +731,8 @@ ldp_pselect (int nfds, fd_set * __restrict readfds,
       goto done;
     }
 
-  libc_tspec = si_bits ? libc_tspec : *timeout;
+  if (!si_bits)
+    libc_tspec = timeout ? *timeout : libc_tspec;
 
   do
     {
index f5892c1..725f1bf 100644 (file)
@@ -435,6 +435,7 @@ vls_mt_acq_locks (vcl_locked_session_t * vls, vls_mt_ops_t op, int *locks_acq)
        }
       break;
     case VLS_MT_OP_WRITE:
+      ASSERT (s);
       if (!is_nonblk)
        is_nonblk = vcl_session_write_ready (s) != 0;
       if (!is_nonblk)
index 9df27fa..2dfb6a4 100644 (file)
@@ -570,7 +570,7 @@ close_session:
   return 0;
 
 postpone:
-  svm_fifo_set_event (hs->rx_fifo);
+  (void) svm_fifo_set_event (hs->rx_fifo);
   session_send_io_evt_to_thread (hs->rx_fifo, FIFO_EVENT_BUILTIN_RX);
   return 0;