[dpdk-dev] [PATCH 2/8] crypto/dpaa2_sec: add check for the session validity

Hemant Agrawal hemant.agrawal at nxp.com
Fri Oct 25 10:33:30 CEST 2019


Check if the session is not null during processing.

Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 52e522e4a..87220044a 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1368,6 +1368,9 @@ build_sec_fd(struct rte_crypto_op *op,
 	else
 		return -1;
 
+	if (!sess)
+		return -1;
+
 	/* Any of the buffer is segmented*/
 	if (!rte_pktmbuf_is_contiguous(op->sym->m_src) ||
 		  ((op->sym->m_dst != NULL) &&
-- 
2.17.1



More information about the dev mailing list