From: Tiwei Bie Date: Thu, 20 Jun 2019 02:34:34 +0000 (+0800) Subject: net/virtio: fix memory leak in mergeable Rx X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=674effd868865edbb06c49119e0ff215498d32b5;p=dpdk.git net/virtio: fix memory leak in mergeable Rx When there is no enough segments for a packet in mergeable Rx path, we should free the whole mbuf chain instead of just recycling the last segment. Fixes: bcac5aa207f8 ("net/virtio: improve batching in mergeable path") Cc: stable@dpdk.org Reviewed-by: Maxime Coquelin Signed-off-by: Tiwei Bie --- diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index e4d5b6f099..98f4b00a17 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1736,7 +1736,7 @@ virtio_recv_mergeable_pkts(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; }