From 1cbc164ebd8a11a5e850454d7425f01612a74bc4 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 20 Jun 2019 10:34:35 +0800 Subject: [PATCH] net/virtio: fix memory leak in mergeable packed Rx When there is no enough segments for a packet in mergeable packed Rx path, we should free the whole mbuf chain instead of just recycling the last segment. Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues") Cc: stable@dpdk.org Reviewed-by: Maxime Coquelin Signed-off-by: Tiwei Bie --- drivers/net/virtio/virtio_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 98f4b00a17..df0fe066f9 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1909,7 +1909,7 @@ virtio_recv_mergeable_pkts_packed(void *rx_queue, } else { PMD_RX_LOG(ERR, "No enough segments for packet."); - virtio_discard_rxbuf(vq, prev); + rte_pktmbuf_free(rx_pkts[nb_rx]); rxvq->stats.errors++; break; } -- 2.20.1