From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from netronome.com (host-79-78-33-110.static.as9105.net [79.78.33.110]) by dpdk.org (Postfix) with ESMTP id E879B1B2FD; Wed, 8 Nov 2017 12:59:52 +0100 (CET) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id vA8BxjWC023748; Wed, 8 Nov 2017 11:59:45 GMT Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id vA8Bxj43023747; Wed, 8 Nov 2017 11:59:45 GMT From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org Date: Wed, 8 Nov 2017 11:59:45 +0000 Message-Id: <1510142385-23710-1-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-stable] [PATCH] net/nfp: initialize stats struct X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 11:59:53 -0000 Not all struct fields will be written and random data could confuse readers. Fixes: 92aa491b881e ("nfp: add statistics") Coverity: 140755 Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 2 ++ 1 file changed, 2 insertions(+) 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 @@ enum nfp_qcp_ptr { /* 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) -- 1.9.1