From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C65736CC6 for ; Wed, 18 May 2016 18:12:47 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 18 May 2016 09:12:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,329,1459839600"; d="scan'208";a="705170680" Received: from sie-lab-214-241.ir.intel.com (HELO silpixa00382162.ir.intel.com) ([10.237.214.241]) by FMSMGA003.fm.intel.com with ESMTP; 18 May 2016 09:12:41 -0700 From: Deepak Kumar Jain To: john.griffin@intel.com, fiona.trahe@intel.com, declan.doherty@intel.com Cc: deepak.k.jain@intel.com, dev@dpdk.org Date: Wed, 18 May 2016 17:12:38 +0100 Message-Id: <1463587958-154335-1-git-send-email-deepak.k.jain@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] qat: fix null pointer dereferencing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 16:12:48 -0000 Fix null pointer dereferencing while clearing session Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices") Coverity ID 126586 Signed-off-by: Deepak kumar JAIN --- drivers/crypto/qat/qat_crypto.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 495ea1c..a084692 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 -- 2.5.5