diff options
author | Chenmin Sun <chenmin.sun@intel.com> | 2020-09-11 22:32:51 +0800 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-09-12 21:54:43 +0000 |
commit | f1b7953449b5ec5a21b359c35ad4d587d02da788 (patch) | |
tree | cf1ec78cc4326c9d7492a29de8c7f2b7e469721c /src | |
parent | f96ce156b574e22455258aa84215f310b688596e (diff) |
dpdk: fix coverity defect #214232, #182930
Type: fix
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ie328834159687cdb4314c37d36697f2fb9081fbd
(cherry picked from commit 504bcb7c29da6ab45656f54cda394cccb0d97dae)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/dpdk/device/device.c | 7 | ||||
-rw-r--r-- | src/plugins/dpdk/device/init.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c index e58dd6f4228..532987c3130 100644 --- a/src/plugins/dpdk/device/device.c +++ b/src/plugins/dpdk/device/device.c @@ -639,6 +639,13 @@ dpdk_interface_set_rss_queues (struct vnet_main_t *vnm, })); /* *INDENT-ON* */ + /* check valid_queue_count not zero, make coverity happy */ + if (valid_queue_count == 0) + { + err = clib_error_return (0, "must assign at least one valid rss queue"); + goto done; + } + valid_queue = reta; for (i = valid_queue_count, j = 0; i < dev_info.reta_size; i++, j++) { diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 81803ab1cb4..d07acd644a2 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -759,7 +759,7 @@ dpdk_lib_init (dpdk_main_t * dm) dpdk_device_setup (xd); /* rss queues should be configured after dpdk_device_setup() */ - if (devconf->rss_queues != NULL) + if ((hi != NULL) && (devconf->rss_queues != NULL)) { if (vnet_hw_interface_set_rss_queues (vnet_get_main (), hi, devconf->rss_queues)) |