net/vmxnet3: fix receive queue memory leak
authorMandeep Rohilla <mrohilla@brocade.com>
Thu, 15 Jun 2017 12:17:41 +0000 (08:17 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 6 Jul 2017 13:00:57 +0000 (15:00 +0200)
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 <mrohilla@brocade.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
drivers/net/vmxnet3/vmxnet3_rxtx.c

index d8713a1..13c73f6 100644 (file)
@@ -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;
                }