From: Pablo de Lara Date: Fri, 14 Jul 2017 06:48:47 +0000 (+0100) Subject: crypto/aesni_mb: fix zero burst dequeue X-Git-Tag: spdx-start~2398 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0b4b1e1b88edab32a0cdfe706c800c0419c3a16a;p=dpdk.git crypto/aesni_mb: fix zero burst dequeue In the unlikely scenario that an application calls rte_cryptodev_dequeue_burst with nb_ops = 0, there was a job leak, as a job would be created but would not be populated, as no operation is passed. Fixes: 0f548b50a160 ("crypto/aesni_mb: process crypto op on dequeue") Cc: stable@dpdk.org Signed-off-by: Pablo de Lara Acked-by: Declan Doherty --- diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index 13cffaf27b..fda662fe4f 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -644,6 +644,9 @@ aesni_mb_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops, int retval, processed_jobs = 0; + if (unlikely(nb_ops == 0)) + return 0; + do { /* Get next operation to process from ingress queue */ retval = rte_ring_dequeue(qp->ingress_queue, (void **)&op);