diff options
author | Dave Barach <dave@barachs.net> | 2016-11-09 11:28:36 -0500 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2016-11-09 11:29:58 -0500 |
commit | 8d2e0e02433b0097898c332aa0aeedb34c223a6f (patch) | |
tree | ce77af48df355d3de6bafe4837cc93440e02f5cc /vnet/vnet/devices/dpdk/cli.c | |
parent | 8c83ef01c42ad218ec2803a790625085702cd38a (diff) |
Fix a batch of coverity warnings, VPP-486
Change-Id: I0379844824b4c2eb42588d0fb8e1a7eb441e923f
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet/vnet/devices/dpdk/cli.c')
-rw-r--r-- | vnet/vnet/devices/dpdk/cli.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vnet/vnet/devices/dpdk/cli.c b/vnet/vnet/devices/dpdk/cli.c index 85c3e8038f3..c8a1d067a1c 100644 --- a/vnet/vnet/devices/dpdk/cli.c +++ b/vnet/vnet/devices/dpdk/cli.c @@ -1188,6 +1188,10 @@ set_dpdk_if_hqos_tctbl (vlib_main_t * vm, unformat_input_t * input, /* Detect the set of worker threads */ uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers"); + /* Should never happen, shut up Coverity warning */ + if (p == 0) + return clib_error_return (0, "no worker registrations?"); + vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0]; int worker_thread_first = tr->first_index; int worker_thread_count = tr->count; @@ -1224,6 +1228,10 @@ set_dpdk_if_hqos_pktfield (vlib_main_t * vm, unformat_input_t * input, /* Detect the set of worker threads */ uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers"); + /* Should never happen, shut up Coverity warning */ + if (p == 0) + return clib_error_return (0, "no worker registrations?"); + vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0]; int worker_thread_first = tr->first_index; int worker_thread_count = tr->count; @@ -1426,6 +1434,11 @@ show_dpdk_if_hqos (vlib_main_t * vm, unformat_input_t * input, /* Detect the set of worker threads */ p = hash_get_mem (tm->thread_registrations_by_name, "workers"); + + /* Should never happen, shut up Coverity warning */ + if (p == 0) + return clib_error_return (0, "no worker registrations?"); + tr = (vlib_thread_registration_t *) p[0]; cfg = &devconf->hqos; |