summaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2019-04-15 08:48:10 +0000
committerFilip Tehlar <ftehlar@cisco.com>2019-04-15 10:29:02 +0000
commit31398dfacde49cac3e48242dfe340d2e0befb1e1 (patch)
treebc641f33d7f07e6cfd9d41d7c223057ebdb8a410 /src/plugins/unittest
parentc0818bce929b1fe4f494a360cdebb1afdc69e853 (diff)
crypto: fix coverity warnings
Change-Id: Id9dfd912517c44cf812953bd05ac04c9e172a2b7 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/unittest')
-rw-r--r--src/plugins/unittest/crypto_test.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/unittest/crypto_test.c b/src/plugins/unittest/crypto_test.c
index eb73e91e186..c57a275997a 100644
--- a/src/plugins/unittest/crypto_test.c
+++ b/src/plugins/unittest/crypto_test.c
@@ -81,6 +81,10 @@ test_crypto (vlib_main_t * vm, crypto_test_main_t * tm)
r = r->next;
}
+ /* no tests registered */
+ if (n_ops == 0)
+ return 0;
+
vec_sort_with_function (rv, sort_registrations);
vec_validate_aligned (computed_data, computed_data_total_len - 1,
@@ -158,8 +162,6 @@ test_crypto (vlib_main_t * vm, crypto_test_main_t * tm)
op->user_data = i;
op++;
}
- /* next */
- r = r->next;
}
/* *INDENT-ON* */
@@ -177,6 +179,7 @@ test_crypto (vlib_main_t * vm, crypto_test_main_t * tm)
{
case VNET_CRYPTO_OP_TYPE_AEAD_ENCRYPT:
exp_tag = &r->tag;
+ /* fall through */
case VNET_CRYPTO_OP_TYPE_ENCRYPT:
exp_ct = &r->ciphertext;
break;