From: Deepak Kumar Jain Date: Wed, 18 May 2016 16:12:38 +0000 (+0100) Subject: qat: fix null pointer dereferencing X-Git-Tag: spdx-start~6832 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=61d124fd4607058294a0fe617759428afdedb909;p=dpdk.git qat: fix null pointer dereferencing Fix null pointer dereferencing while clearing session Coverity issue: 126586 Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices") Signed-off-by: Deepak Kumar Jain --- diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 495ea1c766..a0846926be 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -276,14 +276,15 @@ void qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session) { struct qat_session *sess = session; - phys_addr_t cd_paddr = sess->cd_paddr; + phys_addr_t cd_paddr; PMD_INIT_FUNC_TRACE(); if (session) { + cd_paddr = sess->cd_paddr; memset(sess, 0, qat_crypto_sym_get_session_private_size(dev)); - sess->cd_paddr = cd_paddr; - } + } else + PMD_DRV_LOG(ERR, "NULL session"); } static int