From fe5fe3820e504380f4abd15f839f63dd6e5c508f Mon Sep 17 00:00:00 2001 From: =?utf8?q?N=C3=A9lio=20Laranjeiro?= Date: Thu, 17 Nov 2016 10:49:54 +0100 Subject: [PATCH] net/mlx5: fix leak when starvation occurs The list of segments to free was wrongly manipulated ending by only freeing the first segment instead of freeing all of them. The last one still belongs to the NIC and thus should not be freed. Fixes: a1bdb71a32da ("net/mlx5: fix crash in Rx") Reported-by: Liming Sun Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 9b598014fe..b31b33b015 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1310,10 +1310,10 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) } while (pkt != seg) { assert(pkt != (*rxq->elts)[idx]); - seg = NEXT(pkt); + rep = NEXT(pkt); rte_mbuf_refcnt_set(pkt, 0); __rte_mbuf_raw_free(pkt); - pkt = seg; + pkt = rep; } break; } -- 2.20.1