patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/nfp: initialize stats struct
@ 2017-11-08 11:59 Alejandro Lucero
  2017-11-10  1:10 ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
  2017-11-10  9:37 ` Ferruh Yigit
  0 siblings, 2 replies; 5+ messages in thread
From: Alejandro Lucero @ 2017-11-08 11:59 UTC (permalink / raw)
  To: dev; +Cc: stable

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 <alejandro.lucero@netronome.com>
---
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-10  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 11:59 [dpdk-stable] [PATCH] net/nfp: initialize stats struct Alejandro Lucero
2017-11-10  1:10 ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2017-11-10  4:05   ` Stephen Hemminger
2017-11-10  8:55     ` Ferruh Yigit
2017-11-10  9:37 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).