From: Tiwei Bie Date: Thu, 20 Jun 2019 02:34:35 +0000 (+0800) Subject: net/virtio: fix memory leak in mergeable packed Rx X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1cbc164ebd8a11a5e850454d7425f01612a74bc4;p=dpdk.git 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 --- 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; }