DPDK patches and discussions
 help / color / mirror / Atom feed
From: Deepak Kumar Jain <deepak.k.jain@intel.com>
To: declan.doherty@intel.com
Cc: deepak.k.jain@intel.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH] crypto: fix null pointer dereferencing
Date: Mon, 23 May 2016 16:46:53 +0100	[thread overview]
Message-ID: <1464018413-71800-1-git-send-email-deepak.k.jain@intel.com> (raw)

From: "Jain, Deepak K" <deepak.k.jain@intel.com>

Fix null pointer dereferencing by reporing if null and
exiting the function.

Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
Coverity issue: 126584

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
---
 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

             reply	other threads:[~2016-05-23 15:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 15:46 Deepak Kumar Jain [this message]
2016-06-02 13:58 ` De Lara Guarch, Pablo
2016-06-07  9:36 ` [dpdk-dev] [PATCH v2] aesni_mb: " Jain, Deepak K
2016-06-07 11:04   ` De Lara Guarch, Pablo
2016-06-07 14:34     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464018413-71800-1-git-send-email-deepak.k.jain@intel.com \
    --to=deepak.k.jain@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).