DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ciara Power <ciara.power@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, roy.fan.zhang@intel.com,
	Ciara Power <ciara.power@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>
Subject: [dpdk-dev] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer
Date: Thu, 12 Aug 2021 14:24:35 +0000	[thread overview]
Message-ID: <20210812142436.108053-3-ciara.power@intel.com> (raw)
In-Reply-To: <20210812142436.108053-1-ciara.power@intel.com>

The env.digest memory was freed, but the pointer was not set to NULL
afterwards. This caused an "Invalid Memory" error, as the pointer tries
to free twice.

Fixes: 952e10cdad5e ("examples/fips_validation: support scatter gather list")
Cc: roy.fan.zhang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 examples/fips_validation/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index 2db00620ce..5d14513a58 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -1846,8 +1846,10 @@ fips_test_one_file(void)
 
 	fips_test_clear();
 
-	if (env.digest)
+	if (env.digest) {
 		rte_free(env.digest);
+		env.digest = NULL;
+	}
 	if (env.mbuf)
 		rte_pktmbuf_free(env.mbuf);
 
-- 
2.25.1


  parent reply	other threads:[~2021-08-12 14:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 14:24 [dpdk-dev] [PATCH v1 0/2] fips validation app fixes Ciara Power
2021-08-12 14:24 ` [dpdk-dev] [PATCH v1 1/2] examples/fips_validation: fix unused malloc Ciara Power
2021-08-16 15:21   ` Zhang, Roy Fan
2021-08-12 14:24 ` Ciara Power [this message]
2021-08-16 15:22   ` [dpdk-dev] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer Zhang, Roy Fan
2021-10-05  8:17 ` [dpdk-dev] [EXT] [PATCH v1 0/2] fips validation app fixes Akhil Goyal

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=20210812142436.108053-3-ciara.power@intel.com \
    --to=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=marko.kovacevic@intel.com \
    --cc=roy.fan.zhang@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).