From: Dror Birkman <dror.birkman@lightcyber.com>
To: nicolas.pernas.maradei@emutex.com, ferruh.yigit@intel.com
Cc: dev@dpdk.org, Dror Birkman <dror.birkman@lightcyber.com>,
stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2] pcap: fix memory leak in jumbo frames
Date: Tue, 20 Sep 2016 15:08:56 +0300 [thread overview]
Message-ID: <1474373336-85875-1-git-send-email-dror.birkman@lightcyber.com> (raw)
If rte_pktmbuf_alloc() fails on any segment that is not the initial
segment, previously allocated mbufs are not freed.
Fixes: 6db141c91e1f ("pcap: support jumbo frames")
Cc: <stable@dpdk.org>
Signed-off-by: Dror Birkman <dror.birkman@lightcyber.com>
---
drivers/net/pcap/rte_eth_pcap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index b7a3b03..db19a66 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -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;
--
2.3.0
next reply other threads:[~2016-09-20 12:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-20 12:08 Dror Birkman [this message]
2016-09-20 13:12 ` Ferruh Yigit
2016-09-21 10:57 ` [dpdk-stable] [dpdk-dev] " Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1474373336-85875-1-git-send-email-dror.birkman@lightcyber.com \
--to=dror.birkman@lightcyber.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=nicolas.pernas.maradei@emutex.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).