diff mbox series

[v1,2/2] examples/fips_validation: fix resetting pointer

Message ID 20210812142436.108053-3-ciara.power@intel.com (mailing list archive)
State Accepted
Delegated to: akhil goyal
Headers show
Series fips validation app fixes | expand

Checks

Context Check Description
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing fail Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/checkpatch success coding style OK

Commit Message

Ciara Power Aug. 12, 2021, 2:24 p.m. UTC
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(-)

Comments

Zhang, Roy Fan Aug. 16, 2021, 3:22 p.m. UTC | #1
> -----Original Message-----
> From: Power, Ciara <ciara.power@intel.com>
> Sent: Thursday, August 12, 2021 3:25 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Power,
> Ciara <ciara.power@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Subject: [PATCH v1 2/2] examples/fips_validation: fix resetting pointer
> 
> 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

Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
diff mbox series

Patch

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