From: Adrien Mazarguil Date: Mon, 23 Nov 2015 14:44:36 +0000 (+0100) Subject: mlx4: fix possible crash when clearing device statistics X-Git-Tag: spdx-start~7994 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0f9db82d9f54b6210bbf9d7fad1c144f00e76ccb;p=dpdk.git mlx4: fix possible crash when clearing device statistics A typo causes TX stats indices to be retrieved from RX queues. Fixes: 7fae69eeff13 ("mlx4: new poll mode driver") Reported-by: Nicolas Harnois Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 4198c046e0..d961a8af58 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -3958,7 +3958,7 @@ mlx4_stats_reset(struct rte_eth_dev *dev) for (i = 0; (i != priv->txqs_n); ++i) { if ((*priv->txqs)[i] == NULL) continue; - idx = (*priv->rxqs)[i]->stats.idx; + idx = (*priv->txqs)[i]->stats.idx; (*priv->txqs)[i]->stats = (struct mlx4_txq_stats){ .idx = idx }; }