net/pcap: fix using mbuf after freeing it
authorJohan Samuelsson <johan.xb.samuelsson@ericsson.com>
Mon, 13 Mar 2017 09:21:25 +0000 (10:21 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 16:59:39 +0000 (18:59 +0200)
Fixes: 2269e7e815a2 ("pcap: add Rx and Tx byte counters")
Cc: stable@dpdk.org
Signed-off-by: Johan Samuelsson <johan.xb.samuelsson@ericsson.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/pcap/rte_eth_pcap.c

index 7f0b650..075e3be 100644 (file)
@@ -293,9 +293,9 @@ eth_pcap_tx_dumper(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
                        }
                }
 
-               rte_pktmbuf_free(mbuf);
                num_tx++;
                tx_bytes += mbuf->pkt_len;
+               rte_pktmbuf_free(mbuf);
        }
 
        /*