fips validation app fixes
cover fips validation app fixes
Included are patches with small fixes for unnecessary memory allocation, and incomplete resetting of a pointer.
Ciara Power (2):
examples/fips_validation: fix unused malloc
examples/fips_validation: fix resetting pointer
examples/fips_validation/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/2 examples/fips_validation: fix unused malloc
The val.val pointer is allocated memory, however this memory is then freed in get_writeback_data() without being used beforehand. The pointer is then allocated memory again before use,
so the very first allocation is removed as it was unnecessary.
--- examples/fips_validation/main.c | 1 - 1 file changed, 1 deletion(-)
examples/fips_validation/main.c +0 -1
@@ -1635,7 +1635,6 @@ fips_mct_sha_test(void)int ret;uint32_t i, j; - val.val =rte_malloc (NULL , (MAX_DIGEST_SIZE *SHA_MD_BLOCK ),0 );for (i =0 ; i <SHA_MD_BLOCK ; i++) md[i].val =rte_malloc (NULL , (MAX_DIGEST_SIZE *2 ),0 );
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH v1 1/2] examples/fips_validation: fix unused malloc
Quoted 37 lines
-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Thursday, August 12, 2021 3:25 PM
To: [email protected]
Cc: [email protected]; Zhang, Roy Fan <[email protected]>; Power, Ciara <[email protected]>; [email protected]; Kovacevic, Marko <[email protected]>
Subject: [PATCH v1 1/2] examples/fips_validation: fix unused mallocThe val.val pointer is allocated memory, however this memory is then freed in
get_writeback_data()without being used beforehand. The pointer is then allocated memory again before use,
so the very first allocation is removed as it was unnecessary.Fixes f4797bae0050 ("examples/fips_validation: support plain SHA")Signed-off-by Ciara Power <[email protected]>--- examples/fips_validation/main.c | 1 - 1 file changed, 1 deletion(-)examples/fips_validation/main.c +0
-2@@ -1635,7 +1635,6 @@ fips_mct_sha_test(void)int ret;uint32_t i, j; - val.val =rte_malloc (NULL , (MAX_DIGEST_SIZE *SHA_MD_BLOCK ),0 );for (i =0 ; i <SHA_MD_BLOCK ; i++) md[i].val =rte_malloc (NULL , (MAX_DIGEST_SIZE *2 ),0 ); --
Quoted 1 line
2.25.1
PATCH 2/2 examples/fips_validation: fix resetting pointer
In reply to Ciara PowerThe 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.
--- examples/fips_validation/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
examples/fips_validation/main.c +3 -1
@@ -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);
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH v1 2/2] examples/fips_validation: fix resetting pointer
Quoted 40 lines
-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Thursday, August 12, 2021 3:25 PM
To: [email protected]
Cc: [email protected]; Zhang, Roy Fan <[email protected]>; Power, Ciara <[email protected]>; Kovacevic, Marko <[email protected]>
Subject: [PATCH v1 2/2] examples/fips_validation: fix resetting pointerThe 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")Signed-off-by Ciara Power <[email protected]>--- examples/fips_validation/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)examples/fips_validation/main.c +3
-2@@ -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); --
Quoted 1 line
2.25.1
Quoted 10 lines
Included are patches with small fixes for unnecessary memory allocation, and incomplete resetting of a pointer.
Ciara Power (2):
examples/fips_validation: fix unused malloc
examples/fips_validation: fix resetting pointerexamples/fips_validation/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Series Applied to dpdk-next-crypto
Thanks.