[dpdk-dev] pcap: fix memory leak in jumbo frames
Commit Message
If rte_pktmbuf_alloc() fails on any segment that is not the initial
segment, previously allocated mbufs are not freed.
Signed-off-by: Dror Birkman <dror.birkman@lightcyber.com>
---
drivers/net/pcap/rte_eth_pcap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Tue, Sep 20, 2016 at 01:39:23PM +0300, Dror Birkman wrote:
> If rte_pktmbuf_alloc() fails on any segment that is not the initial
> segment, previously allocated mbufs are not freed.
You should put a "fixline" here.
Besides that, I think it's a good candidate for stable branch. Thus,
stable@dpdk.org cc'ed.
--yliu
@@ -229,8 +229,10 @@ eth_pcap_rx(void *queue,
if (unlikely(eth_pcap_rx_jumbo(pcap_q->mb_pool,
mbuf,
packet,
- header.caplen) == -1))
+ header.caplen) == -1)) {
+ rte_pktmbuf_free(mbuf);
break;
+ }
}
mbuf->pkt_len = (uint16_t)header.caplen;