From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 364356C9B for ; Tue, 20 Sep 2016 14:09:21 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id l132so205469464wmf.0 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=Ee/hD92g8V6l14JlwqWsue4iJNo7e9Obf5wMVCKfK+ucYtnP+K72szdRGyScoKSy3N aRJzm7v1UbnNJFwFGMDPxGCYQxAM7L/rgxHM9YfykcUlKtIPNobUEWsoNpktftCHMxRD 3hNEGsS1WcAFIxI58hWoBMcbmXK97WYcfRB2huzWq6itVbGEOrjlperYiYM+dsvaIvGX AI+tV11vU6qrFGK6jOCZsnLYo6EugMqnWtKjrHjNo4PVYkUe/4agEWJi/ONAH2HnrbU0 AgTrdwUJFZCcPcV4Pcq+0cY/KHBRdgMiy9zuO7Jy/5kAx8KTiys3aSg122vb1AO2gBXr 0SGA== X-Gm-Message-State: AE9vXwN5sjPrlBtzzkV3qp0fldMdmZ4ac19WR6gG0wVuutO8y7mMukO6U026h1+yei9u+w== 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-stable] [PATCH v2] pcap: fix memory leak in jumbo frames X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches 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