diff mbox series

[2/2] crypto/octeontx2: clear session priv mem upon destroy

Message ID 1625222196-215-2-git-send-email-anoobj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers show
Series [1/2] crypto/octeontx2: reset feature flags during config | expand

Checks

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

Commit Message

Anoob Joseph July 2, 2021, 10:36 a.m. UTC
During session destroy, clear session private memory.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/crypto/octeontx2/otx2_cryptodev_sec.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Akhil Goyal July 7, 2021, 6:59 p.m. UTC | #1
> During session destroy, clear session private memory.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
>  drivers/crypto/octeontx2/otx2_cryptodev_sec.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
> b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
> index 3c5686a..a5db400 100644
> --- a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
> +++ b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
> @@ -589,6 +589,8 @@ otx2_crypto_sec_session_destroy(void *device
> __rte_unused,
> 
>  	sess_mp = rte_mempool_from_obj(priv);
> 
> +	memset(priv, 0, sizeof(*priv));
> +
>  	set_sec_session_private_data(sess, NULL);
>  	rte_mempool_put(sess_mp, priv);
> 
> --
> 2.7.4
Series applied to dpdk-next-crypto

Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
index 3c5686a..a5db400 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
@@ -589,6 +589,8 @@  otx2_crypto_sec_session_destroy(void *device __rte_unused,
 
 	sess_mp = rte_mempool_from_obj(priv);
 
+	memset(priv, 0, sizeof(*priv));
+
 	set_sec_session_private_data(sess, NULL);
 	rte_mempool_put(sess_mp, priv);