Free memory used by virt queue op cookies in dev close.

Fixes: 6f0175ff53e0 ("crypto/virtio: support basic PMD ops")
Cc: [email protected]

Signed-off-by: Gowrishankar Muthukrishnan <[email protected]>
Change-Id: Idbf87e6ef5bede3cadfae587b5a6d7592f5d5cf3
---
 drivers/crypto/virtio/virtio_cryptodev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/crypto/virtio/virtio_cryptodev.c 
b/drivers/crypto/virtio/virtio_cryptodev.c
index d661ce8025..6f079f15f6 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -68,6 +68,7 @@ void
 virtio_crypto_queue_release(struct virtqueue *vq)
 {
        struct virtio_crypto_hw *hw;
+       uint16_t i;
 
        PMD_INIT_FUNC_TRACE();
 
@@ -79,6 +80,9 @@ virtio_crypto_queue_release(struct virtqueue *vq)
                hw->vqs[vq->vq_queue_index] = NULL;
                rte_memzone_free(vq->mz);
                rte_mempool_free(vq->mpool);
+               for (i = 0; i < vq->vq_nentries; i++)
+                       rte_free(vq->vq_descx[i].cookie);
+
                rte_free(vq);
        }
 }
-- 
2.37.1

Reply via email to