summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Lucero <alejandro.lucero@netronome.com>2017-11-08 11:59:45 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2017-11-10 09:31:18 +0000
commit9b634927a71d555ec7314e177d8698347b5cc8e0 (patch)
treeb1a97a81add6a5fe56e7d6943a761f7b010ece7d
parent6c293ffd63b3f61a95d8c492d007160874e7a057 (diff)
downloaddpdk-9b634927a71d555ec7314e177d8698347b5cc8e0.zip
dpdk-9b634927a71d555ec7314e177d8698347b5cc8e0.tar.gz
dpdk-9b634927a71d555ec7314e177d8698347b5cc8e0.tar.xz
net/nfp: fix stats struct initial value
Not all struct fields will be written and random data could confuse readers. Coverity issue: 140755 Fixes: 92aa491b881e ("nfp: add statistics") Cc: stable@dpdk.org Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
-rw-r--r--drivers/net/nfp/nfp_net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 83dec06..0501156 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1038,6 +1038,8 @@ nfp_net_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
/* RTE_ETHDEV_QUEUE_STAT_CNTRS default value is 16 */
+ memset(&nfp_dev_stats, 0, sizeof(nfp_dev_stats));
+
/* reading per RX ring stats */
for (i = 0; i < dev->data->nb_rx_queues; i++) {
if (i == RTE_ETHDEV_QUEUE_STAT_CNTRS)