DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] reorder: fix ready buffers not being nulled out
@ 2017-09-12 15:06 Pavan Nikhilesh
  2017-09-12 15:06 ` [dpdk-dev] [PATCH 2/2] test/reorder: fix reorder drain test Pavan Nikhilesh
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pavan Nikhilesh @ 2017-09-12 15:06 UTC (permalink / raw)
  To: reshma.pattan; +Cc: dev, Pavan Nikhilesh

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 <pbhagavatula@caviumnetworks.com>
---
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-12  8:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-12 15:06 [dpdk-dev] [PATCH 1/2] reorder: fix ready buffers not being nulled out Pavan Nikhilesh
2017-09-12 15:06 ` [dpdk-dev] [PATCH 2/2] test/reorder: fix reorder drain test Pavan Nikhilesh
2017-10-12  8:28   ` Bruce Richardson
2017-10-11 21:04 ` [dpdk-dev] [PATCH 1/2] reorder: fix ready buffers not being nulled out Thomas Monjalon
2017-10-12  8:32 ` Bruce Richardson

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).