From: Fiona Trahe Date: Thu, 6 Oct 2016 17:34:26 +0000 (+0100) Subject: crypto/aesni_mb: free ring memory on queue release X-Git-Tag: spdx-start~5696 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a831c318c54d;p=dpdk.git crypto/aesni_mb: free ring memory on queue release Free ring memory on queue_pair release, else releasing and setting up queue-pair of a different size fails. Signed-off-by: Fiona Trahe --- diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c index d3c46aceef..3d49e2aec8 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c @@ -311,8 +311,14 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev, static int aesni_mb_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { - if (dev->data->queue_pairs[qp_id] != NULL) { - rte_free(dev->data->queue_pairs[qp_id]); + struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id]; + struct rte_ring *r = NULL; + + if (qp != NULL) { + r = rte_ring_lookup(qp->name); + if (r) + rte_ring_free(r); + rte_free(qp); dev->data->queue_pairs[qp_id] = NULL; } return 0;