aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/memif_test.c
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2023-05-05 23:03:46 +0800
committerDamjan Marion <dmarion@0xa5.net>2023-05-16 09:28:07 +0000
commit754f79c36a93adf7ef421181526338e0ac4bf763 (patch)
tree30749016f43948e470c4eecde1249a92d0e1f789 /src/plugins/memif/memif_test.c
parent00c37199d7a784b627a9017c4533a3ca240b9c6d (diff)
memif: fix coverity warnings
Type: fix Signed-off-by: Marvin Liu <yong.liu@intel.com> Change-Id: Ie3f390be16df81f6824344034377f9a6f4fa9f92
Diffstat (limited to 'src/plugins/memif/memif_test.c')
-rw-r--r--src/plugins/memif/memif_test.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/memif/memif_test.c b/src/plugins/memif/memif_test.c
index e8fb37c949f..d3290ac0340 100644
--- a/src/plugins/memif/memif_test.c
+++ b/src/plugins/memif/memif_test.c
@@ -407,12 +407,11 @@ api_memif_create_v2 (vat_main_t *vam)
mp->ring_size = clib_host_to_net_u32 (ring_size);
mp->buffer_size = clib_host_to_net_u16 (buffer_size & 0xffff);
mp->socket_id = clib_host_to_net_u32 (socket_id);
- if (secret != 0)
- {
- char *p = (char *) &mp->secret;
- p += vl_api_vec_to_api_string (secret, (vl_api_string_t *) p);
- vec_free (secret);
- }
+
+ char *p = (char *) &mp->secret;
+ p += vl_api_vec_to_api_string (secret, (vl_api_string_t *) p);
+ vec_free (secret);
+
memcpy (mp->hw_addr, hw_addr, 6);
mp->rx_queues = rx_queues;
mp->tx_queues = tx_queues;