From: Mandeep Rohilla Date: Thu, 15 Jun 2017 12:17:41 +0000 (-0400) Subject: net/vmxnet3: fix receive queue memory leak X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0bf3a2c07e8f18b7ab3cdf42a4c932af8f7280fc;p=dpdk.git net/vmxnet3: fix receive queue memory leak This addresses an mbuf leak in an error condition during packet receive. Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") Cc: stable@dpdk.org Signed-off-by: Mandeep Rohilla Acked-by: Shrikrishna Khare --- diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index d8713a1e5f..13c73f66ee 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -800,6 +800,12 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) (int)(rcd - (struct Vmxnet3_RxCompDesc *) rxq->comp_ring.base), rcd->rxdIdx); rte_pktmbuf_free_seg(rxm); + if (rxq->start_seg) { + struct rte_mbuf *start = rxq->start_seg; + + rxq->start_seg = NULL; + rte_pktmbuf_free(start); + } goto rcd_done; }