From: Fiona Trahe Date: Tue, 29 Mar 2016 17:10:20 +0000 (+0100) Subject: qat: fix crash when nothing to enqueue X-Git-Tag: spdx-start~7126 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2f481bda801703092363c94d6d78b6644fd2d1df;p=dpdk.git 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 --- 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;