From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 71D2868DD for ; Tue, 7 Jun 2016 11:36:21 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 07 Jun 2016 02:36:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,432,1459839600"; d="scan'208";a="715140662" 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; 07 Jun 2016 02:36:19 -0700 From: "Jain, Deepak K" To: dev@dpdk.org Cc: declan.doherty@intel.com, deepak.k.jain@intel.com Date: Tue, 7 Jun 2016 10:36:11 +0100 Message-Id: <1465292171-189465-1-git-send-email-deepak.k.jain@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464018413-71800-1-git-send-email-deepak.k.jain@intel.com> References: <1464018413-71800-1-git-send-email-deepak.k.jain@intel.com> Subject: [dpdk-dev] [PATCH v2] aesni_mb: 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: Tue, 07 Jun 2016 09:36:21 -0000 Fix null pointer dereferencing by reporing if null and exiting the function. Coverity issue: 126584 Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented") Signed-off-by: Deepak Kumar Jain --- v2: Corrected PMD name in commit message drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index 9c42f88..31784e1 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -379,9 +379,11 @@ process_crypto_op(struct aesni_mb_qp *qp, struct rte_crypto_op *op, /* append space for output data to mbuf */ char *odata = rte_pktmbuf_append(m_dst, rte_pktmbuf_data_len(op->sym->m_src)); - if (odata == NULL) + if (odata == NULL) { MB_LOG_ERR("failed to allocate space in destination " "mbuf for source data"); + return NULL; + } memcpy(odata, rte_pktmbuf_mtod(op->sym->m_src, void*), rte_pktmbuf_data_len(op->sym->m_src)); -- 2.5.5