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 aed612b..cc2b504 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 8cd1820..d79904b 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;