From 2f481bda801703092363c94d6d78b6644fd2d1df Mon Sep 17 00:00:00 2001 From: Fiona Trahe Date: Tue, 29 Mar 2016 18:10:20 +0100 Subject: [PATCH] qat: fix crash when nothing to enqueue Crash seen in qat pmd when nb_ops=0 on rte_cryptodev_enqueue_burst() API Signed-off-by: Fiona Trahe --- drivers/crypto/qat/qat_crypto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 5c41a89817..9001558e2f 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -570,6 +570,9 @@ qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops, register uint32_t tail; int overflow; + if (unlikely(nb_ops == 0)) + return 0; + /* read params used a lot in main loop into registers */ queue = &(tmp_qp->tx_q); base_addr = (uint8_t *)queue->base_addr; -- 2.20.1