summaryrefslogtreecommitdiffstats
path: root/vpp/vpp-api/api.c
diff options
context:
space:
mode:
authorJuraj Sloboda <jsloboda@cisco.com>2016-09-06 04:43:52 -0700
committerJuraj Sloboda <jsloboda@cisco.com>2016-09-07 00:06:01 -0700
commit24648ad088c4feea39f8e9fda82c35d207af45e0 (patch)
treea0a419a50959d81779edcb7849f34eb6d096a43d /vpp/vpp-api/api.c
parent7a35ee91a40e512b353f8f41f7a2d5fe32a29eca (diff)
Fix bugs in IPFIX code discovered by coverity
Change-Id: Ibe6ccb99c3c29c14efb34191f209a2f6a14293f7 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'vpp/vpp-api/api.c')
-rw-r--r--vpp/vpp-api/api.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index 36532434..44afd674 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -7894,6 +7894,8 @@ vl_api_classify_session_dump_t_handler (vl_api_classify_session_dump_t * mp)
vnet_classify_table_t *t;
q = vl_api_client_index_to_input_queue (mp->client_index);
+ if (!q)
+ return;
/* *INDENT-OFF* */
pool_foreach (t, cm->tables,
@@ -8094,6 +8096,8 @@ static void
vl_api_ipfix_classify_stream_details_t *rmp;
q = vl_api_client_index_to_input_queue (mp->client_index);
+ if (!q)
+ return;
rmp = vl_msg_api_alloc (sizeof (*rmp));
memset (rmp, 0, sizeof (*rmp));
@@ -8174,19 +8178,10 @@ static void
args.src_port = fcm->src_port;
rv = vnet_flow_report_add_del (frm, &args);
- if (rv != 0)
- goto out;
- if (is_add)
- {
- if (rv != 0)
- ipfix_classify_delete_table (table - fcm->tables);
- }
- else
- {
- if (rv == 0)
- ipfix_classify_delete_table (table - fcm->tables);
- }
+ /* If deleting, or add failed */
+ if (is_add == 0 || (rv && is_add))
+ ipfix_classify_delete_table (table - fcm->tables);
out:
REPLY_MACRO (VL_API_SET_IPFIX_CLASSIFY_STREAM_REPLY);
@@ -8222,6 +8217,8 @@ static void
u32 i;
q = vl_api_client_index_to_input_queue (mp->client_index);
+ if (!q)
+ return;
for (i = 0; i < vec_len (fcm->tables); i++)
if (ipfix_classify_table_index_valid (i))