DPDK patches and discussions
 help / color / mirror / Atom feed
From: Volodymyr Fialko <vfialko@marvell.com>
To: <dev@dpdk.org>, Reshma Pattan <reshma.pattan@intel.com>,
	David Hunt <david.hunt@intel.com>
Cc: <jerinj@marvell.com>, <anoobj@marvell.com>,
	Volodymyr Fialko <vfialko@marvell.com>
Subject: [PATCH 2/2] test/reorder: fix double free of drained buffers
Date: Sat, 7 Jan 2023 16:19:39 +0100	[thread overview]
Message-ID: <20230107151939.2540148-3-vfialko@marvell.com> (raw)
In-Reply-To: <20230107151939.2540148-1-vfialko@marvell.com>

Set to zero array of drained buffers after free, to prevent freeing them
one more time.
Discovered with enabled `RTE_LIBRTE_MEMPOOL_DEBUG`.

Fixes: ecd867faa860 ("test/reorder: fix freeing mbuf twice")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 app/test/test_reorder.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test/test_reorder.c b/app/test/test_reorder.c
index f0714a5c18..7b5e590bac 100644
--- a/app/test/test_reorder.c
+++ b/app/test/test_reorder.c
@@ -278,6 +278,7 @@ test_reorder_drain(void)
 		goto exit;
 	}
 	rte_pktmbuf_free(robufs[0]);
+	memset(robufs, 0, sizeof(robufs));
 
 	/* Insert more packets
 	 * RB[] = {NULL, NULL, NULL, NULL}
@@ -313,6 +314,7 @@ test_reorder_drain(void)
 	for (i = 0; i < 3; i++) {
 		rte_pktmbuf_free(robufs[i]);
 	}
+	memset(robufs, 0, sizeof(robufs));
 
 	/*
 	 * RB[] = {NULL, NULL, NULL, NULL}
-- 
2.34.1


  parent reply	other threads:[~2023-01-07 15:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07 15:19 [PATCH 0/2] lib/reorder: fix drain/free issues Volodymyr Fialko
2023-01-07 15:19 ` [PATCH 1/2] reorder: invalidate buf from ready queue in drain Volodymyr Fialko
2023-02-07 16:24   ` Stephen Hemminger
2023-01-07 15:19 ` Volodymyr Fialko [this message]
2023-01-26 15:51   ` [PATCH 2/2] test/reorder: fix double free of drained buffers David Marchand
2023-02-07 16:25   ` Stephen Hemminger
2023-01-26 15:47 ` [PATCH 0/2] lib/reorder: fix drain/free issues David Marchand
2023-02-07 11:18   ` Thomas Monjalon
2023-02-06 15:47 ` Volodymyr Fialko
2023-02-19 23:19 ` Thomas Monjalon

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=20230107151939.2540148-3-vfialko@marvell.com \
    --to=vfialko@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=reshma.pattan@intel.com \
    /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).