From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 3F1366CA8 for ; Tue, 20 Sep 2016 14:09:21 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id l132so31518232wmf.1 for ; Tue, 20 Sep 2016 05:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightcyber-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ykQ9By+QoYJsoZakkj82bQUp8FikYnOwL7R49vzlfVE=; b=hgQFwB1jyHJgXka9GDkekVNB5ukqNq2faOouyb1o4oP/MzZI2v7qdBUKyh1dW2KTV8 N9ZCWWDEVzY6fHsPyY/fmv7F+PABZuULObGR2tobe7dfqHqZz4GSdWtzid4wU1lM+f+k G2kVyRNc/+elpaLqDyqIIoDAOkkiMoQQjGKKday18FJpta5ARzHzkYzvQjAwK383Beuc KLUAqf4aBfp+j+CfTRQHyE3sAnOFm3WUjDpl7ly/DgImZwrrCJffI8SG2qNecAxjWGLw y9rR/ENHDQQT2PoXFDQQ6Q5Qv0ztiPbVWTUU7HH9k/CvHEEsMRoix+CNhdNEgdQOwaow 8ldQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ykQ9By+QoYJsoZakkj82bQUp8FikYnOwL7R49vzlfVE=; b=FvXB8cTY4SBUG0pSXgXOoOXS4hNWxD0P/f/wNWUNYbHDyZo6OrgvOhn/xoo3rlw0pb bDQ1ND85LeyoBVwHJl/Wj9NGnDziyk1d9M8zZcZ4FDx50IVWelb2sZbjAcAPWr2RKGTU kd/x30u8BAEqJun1fL0LiCaS3eThem3xkm4XEXhbvS8BJCk5g37yccODSrjU7NTiN9rz yCh6QF38uyjrjopMPWeKubPdHmJC/elay/Adu1zPwlocZaI3av+V1FAZZOUuRGqGOA6x pufjpxyj03X1ly8Ypg7xVXWeNqfoqKZhzm98bUfWA8IEmuP2ZM2J0tp5sOIwloG0wcA+ 02ww== X-Gm-Message-State: AE9vXwO9f5D7nwPteVRXM2qmA+3X5WIgJfO9seNaYvi/dp2eHJIp4rjEpltHPDV15xBG5A== X-Received: by 10.28.181.68 with SMTP id e65mr3177369wmf.132.1474373360968; Tue, 20 Sep 2016 05:09:20 -0700 (PDT) Received: from localhost.localdomain (bzq-156-168-31-238.red.bezeqint.net. [31.168.156.238]) by smtp.gmail.com with ESMTPSA id r194sm27175540wmf.22.2016.09.20.05.09.19 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 20 Sep 2016 05:09:20 -0700 (PDT) From: Dror Birkman To: nicolas.pernas.maradei@emutex.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, Dror Birkman , stable@dpdk.org Date: Tue, 20 Sep 2016 15:08:56 +0300 Message-Id: <1474373336-85875-1-git-send-email-dror.birkman@lightcyber.com> X-Mailer: git-send-email 2.6.3 Subject: [dpdk-dev] [PATCH v2] pcap: fix memory leak in jumbo frames X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2016 12:09:21 -0000 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: Signed-off-by: Dror Birkman --- 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