From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org, konstantin.ananyev@intel.com, akhil.goyal@nxp.com
Cc: Bernard Iremonger <bernard.iremonger@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH 1/2] test/ipsec: fix teardown function
Date: Fri, 28 Jun 2019 14:29:21 +0100 [thread overview]
Message-ID: <1561728562-11213-2-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1561728562-11213-1-git-send-email-bernard.iremonger@intel.com>
Set freed cop pointers to NULL
Set other freed pointers to NULL instead of 0
Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
app/test/test_ipsec.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
index 5389a59..2328342 100644
--- a/app/test/test_ipsec.c
+++ b/app/test/test_ipsec.c
@@ -451,8 +451,10 @@ ut_teardown(void)
for (i = 0; i < BURST_SIZE; i++) {
/* free crypto operation structure */
- if (ut_params->cop[i])
+ if (ut_params->cop[i]) {
rte_crypto_op_free(ut_params->cop[i]);
+ ut_params->cop[i] = NULL;
+ }
/*
* free mbuf - both obuf and ibuf are usually the same,
@@ -462,17 +464,17 @@ ut_teardown(void)
if (ut_params->obuf[i]) {
rte_pktmbuf_free(ut_params->obuf[i]);
if (ut_params->ibuf[i] == ut_params->obuf[i])
- ut_params->ibuf[i] = 0;
- ut_params->obuf[i] = 0;
+ ut_params->ibuf[i] = NULL;
+ ut_params->obuf[i] = NULL;
}
if (ut_params->ibuf[i]) {
rte_pktmbuf_free(ut_params->ibuf[i]);
- ut_params->ibuf[i] = 0;
+ ut_params->ibuf[i] = NULL;
}
if (ut_params->testbuf[i]) {
rte_pktmbuf_free(ut_params->testbuf[i]);
- ut_params->testbuf[i] = 0;
+ ut_params->testbuf[i] = NULL;
}
}
--
2.7.4
next parent reply other threads:[~2019-06-28 13:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1561728562-11213-1-git-send-email-bernard.iremonger@intel.com>
2019-06-28 13:29 ` Bernard Iremonger [this message]
2019-06-28 13:29 ` [dpdk-stable] [PATCH 2/2] test/ipsec: fix destroy sa function Bernard Iremonger
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=1561728562-11213-2-git-send-email-bernard.iremonger@intel.com \
--to=bernard.iremonger@intel.com \
--cc=akhil.goyal@nxp.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=stable@dpdk.org \
/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).