X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcrypto%2Fmvsam%2Frte_mrvl_pmd_ops.c;h=2dfaa0b1138484e1910d48fb7462ca5c375f28ea;hb=39b88344e36426bea97cb131fb8ff5b4348e4676;hp=ef520356ff142394e7f1bb47a21310cbd21610f9;hpb=725d2a7fbf717d9a6189ac9b49bad2b4f5391a60;p=dpdk.git diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c index ef520356ff..2dfaa0b113 100644 --- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c @@ -10,7 +10,7 @@ #include #include -#include "rte_mrvl_pmd_private.h" +#include "mrvl_pmd_private.h" /** * Capabilities list to be used in reporting to DPDK. @@ -727,7 +727,7 @@ mrvl_crypto_pmd_sym_session_get_size(__rte_unused struct rte_cryptodev *dev) /** Configure the session from a crypto xform chain (PMD ops callback). * * @param dev Pointer to the device structure. - * @param xform Pointer to the crytpo configuration structure. + * @param xform Pointer to the crypto configuration structure. * @param sess Pointer to the empty session structure. * @returns 0 upon success, negative value otherwise. */ @@ -751,6 +751,8 @@ mrvl_crypto_pmd_sym_session_configure(__rte_unused struct rte_cryptodev *dev, return -ENOMEM; } + memset(sess_private_data, 0, sizeof(struct mrvl_crypto_session)); + ret = mrvl_crypto_set_session_parameters(sess_private_data, xform); if (ret != 0) { MRVL_LOG(ERR, "Failed to configure session parameters!"); @@ -769,6 +771,12 @@ mrvl_crypto_pmd_sym_session_configure(__rte_unused struct rte_cryptodev *dev, return -EIO; } + /* free the keys memory allocated for session creation */ + if (mrvl_sess->sam_sess_params.cipher_key != NULL) + free(mrvl_sess->sam_sess_params.cipher_key); + if (mrvl_sess->sam_sess_params.auth_key != NULL) + free(mrvl_sess->sam_sess_params.auth_key); + return 0; }