summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2017-07-14 07:48:47 +0100
committerYuanhan Liu <yliu@fridaylinux.org>2017-08-29 14:50:27 +0800
commit28c88cd10670c7ac90b90ee291b682232252f124 (patch)
treee6b19c1aa6a1b3181961b6576ca04c87d757fcea
parentec0835f9dcf8b0c038a80de9981cd3b62ba0d6f2 (diff)
downloaddpdk-stable-28c88cd10670c7ac90b90ee291b682232252f124.zip
dpdk-stable-28c88cd10670c7ac90b90ee291b682232252f124.tar.gz
dpdk-stable-28c88cd10670c7ac90b90ee291b682232252f124.tar.xz
crypto/aesni_mb: fix zero burst dequeue
[ upstream commit 0b4b1e1b88edab32a0cdfe706c800c0419c3a16a ] 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") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com>
-rw-r--r--drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index 9d40a9f..06a6435 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -622,6 +622,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);