crypto/dpaa: reset session before init
authorAkhil Goyal <akhil.goyal@nxp.com>
Thu, 30 Aug 2018 05:50:57 +0000 (11:20 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 26 Sep 2018 11:20:26 +0000 (13:20 +0200)
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
drivers/crypto/dpaa_sec/dpaa_sec.c

index aed612b5536e10572a1653f9bbb73ad8365934ee..cc2b504d825c419fa21c57d02d2870b80d1b363e 100644 (file)
@@ -2099,6 +2099,7 @@ dpaa2_sec_set_session_parameters(struct rte_cryptodev *dev,
                return -1;
        }
 
+       memset(session, 0, sizeof(dpaa2_sec_session));
        /* Default IV length = 0 */
        session->iv.length = 0;
 
@@ -2156,6 +2157,7 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
 
        PMD_INIT_FUNC_TRACE();
 
+       memset(session, 0, sizeof(dpaa2_sec_session));
        if (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
                cipher_xform = &conf->crypto_xform->cipher;
                auth_xform = &conf->crypto_xform->next->auth;
index 8cd18208f5d0727301abd5492a5ac8fb4febc7cc..d79904b615d0c8cd4f8c6925ac673c189c98d1c8 100644 (file)
@@ -1762,6 +1762,7 @@ dpaa_sec_set_session_parameters(struct rte_cryptodev *dev,
                DPAA_SEC_ERR("invalid session struct");
                return -EINVAL;
        }
+       memset(session, 0, sizeof(dpaa_sec_session));
 
        /* Default IV length = 0 */
        session->iv.length = 0;
@@ -1896,6 +1897,7 @@ dpaa_sec_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 
        PMD_INIT_FUNC_TRACE();
 
+       memset(session, 0, sizeof(dpaa_sec_session));
        if (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
                cipher_xform = &conf->crypto_xform->cipher;
                auth_xform = &conf->crypto_xform->next->auth;