[dpdk-stable] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer

Zhang, Roy Fan roy.fan.zhang at intel.com
Mon Aug 16 17:22:20 CEST 2021


> -----Original Message-----
> From: Power, Ciara <ciara.power at intel.com>
> Sent: Thursday, August 12, 2021 3:25 PM
> To: dev at dpdk.org
> Cc: stable at dpdk.org; Zhang, Roy Fan <roy.fan.zhang at intel.com>; Power,
> Ciara <ciara.power at intel.com>; Kovacevic, Marko
> <marko.kovacevic at 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 at intel.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power at 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 at intel.com>


More information about the stable mailing list