aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-09-04 19:47:52 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-09-06 08:37:20 +0000
commit145987776f57de20e9724d58fe28796d40ffebfa (patch)
treeb63fb0f62472dc15660c9a1f6a721d33d04e8587 /src/vcl/vppcom.c
parentab2f6dbf9f7b7164a9810f4c80c8abf8463e42ad (diff)
vcl/session/svm: fix coverity warnings
Change-Id: I27532b3ab244dc95955e836a42b229a6e4e32818 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 60d5eb3539a..1991e3e7277 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -1635,6 +1635,8 @@ vcl_select_handle_mq (vcl_worker_t * wrk, svm_msg_q_t * mq,
case FIFO_EVENT_APP_RX:
sid = e->fifo->client_session_index;
session = vcl_session_get (wrk, sid);
+ if (!session)
+ break;
if (sid < n_bits && read_map)
{
clib_bitmap_set_no_check (read_map, sid, 1);
@@ -1660,6 +1662,8 @@ vcl_select_handle_mq (vcl_worker_t * wrk, svm_msg_q_t * mq,
break;
}
session = vcl_ct_session_get_from_fifo (wrk, e->fifo, 0);
+ if (!session)
+ break;
sid = session->session_index;
if (sid < n_bits && read_map)
{
@@ -1669,9 +1673,9 @@ vcl_select_handle_mq (vcl_worker_t * wrk, svm_msg_q_t * mq,
break;
case SESSION_IO_EVT_CT_RX:
session = vcl_ct_session_get_from_fifo (wrk, e->fifo, 1);
- sid = session->session_index;
if (!session)
break;
+ sid = session->session_index;
if (sid < n_bits && write_map)
{
clib_bitmap_set_no_check (write_map, sid, 1);
@@ -2417,6 +2421,9 @@ vppcom_epoll_wait (uint32_t vep_handle, struct epoll_event *events,
}
vep_session = vcl_session_get_w_handle (wrk, vep_handle);
+ if (!vep_session)
+ return VPPCOM_EBADFD;
+
if (PREDICT_FALSE (!vep_session->is_vep))
{
clib_warning ("VCL<%d>: ERROR: vep_idx (%u) is not a vep!",