DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org, fiona.trahe@intel.com,
	konstantin.ananyev@intel.com, akhil.goyal@nxp.com
Cc: Bernard Iremonger <bernard.iremonger@intel.com>
Subject: [dpdk-dev] [PATCH] crypto/qat: fix second seg fault in QAT PMD
Date: Mon,  8 Apr 2019 13:26:10 +0100	[thread overview]
Message-ID: <1554726370-16591-1-git-send-email-bernard.iremonger@intel.com> (raw)

While running the IPsec unit tests the following
segmentation fault is occurring:

Thread 1 "test" received signal SIGSEGV, Segmentation fault.
0x0000000000bf3b50 in qat_sym_process_response (
op=0x5355280 <unittest_params+512>, resp=0x100455100 "")
at /root/dpdk/drivers/crypto/qat/qat_sym.h:161
161	if (sess->bpi_ctx)

Fixes: 91614c73b67c ("crypto/qat: make response process function inline")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/crypto/qat/qat_sym.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h
index bc6426c..685c6c0 100644
--- a/drivers/crypto/qat/qat_sym.h
+++ b/drivers/crypto/qat/qat_sym.h
@@ -157,10 +157,12 @@ qat_sym_process_response(void **op, uint8_t *resp)
 						rx_op->sym->session,
 						cryptodev_qat_driver_id);
 
-
-		if (sess->bpi_ctx)
+		if (sess == NULL)
+			rx_op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
+		else if (sess->bpi_ctx) {
 			qat_bpicipher_postprocess(sess, rx_op);
-		rx_op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
+			rx_op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
+		}
 	}
 	*op = (void *)rx_op;
 }
-- 
2.7.4

             reply	other threads:[~2019-04-08 12:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 12:26 Bernard Iremonger [this message]
2019-04-08 12:26 ` Bernard Iremonger
2019-04-08 16:44 ` Trahe, Fiona
2019-04-08 16:44   ` Trahe, Fiona
2019-04-08 16:56   ` Iremonger, Bernard
2019-04-08 16:56     ` Iremonger, Bernard
2019-04-10 14:19     ` Iremonger, Bernard
2019-04-10 14:19       ` Iremonger, Bernard

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=1554726370-16591-1-git-send-email-bernard.iremonger@intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=konstantin.ananyev@intel.com \
    /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).