From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Subject: [PATCH 1/2] reorder: fix ready buffers not being nulled out Date: Tue, 12 Sep 2017 20:36:03 +0530 Message-ID: <1505228764-9738-1-git-send-email-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, Pavan Nikhilesh To: reshma.pattan@intel.com Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0071.outbound.protection.outlook.com [104.47.34.71]) by dpdk.org (Postfix) with ESMTP id 757BCFFA for ; Tue, 12 Sep 2017 17:06:56 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The ready buffers should be set to NULL when drained else it might result in double free (mempool put) when rte_reorder_free is called. Fixes: b70b56032bff ("reorder: new library") Signed-off-by: Pavan Nikhilesh --- lib/librte_reorder/rte_reorder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_reorder/rte_reorder.c b/lib/librte_reorder/rte_reorder.c index 010dff6..302eba6 100644 --- a/lib/librte_reorder/rte_reorder.c +++ b/lib/librte_reorder/rte_reorder.c @@ -392,6 +392,7 @@ rte_reorder_drain(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs, /* Try to fetch requested number of mbufs from ready buffer */ while ((drain_cnt < max_mbufs) && (ready_buf->tail != ready_buf->head)) { mbufs[drain_cnt++] = ready_buf->entries[ready_buf->tail]; + ready_buf->entries[ready_buf->tail] = NULL; ready_buf->tail = (ready_buf->tail + 1) & ready_buf->mask; } -- 2.7.4