[PATCH v2] crypto/virtio: free memory used by op cookies

Gowrishankar Muthukrishnan gmuthukrishn at marvell.com
Sat Oct 11 06:37:03 CEST 2025


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

Fixes: 6f0175ff53e0 ("crypto/virtio: support basic PMD ops")
Cc: stable at dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
---
V2:
 - patch description updated.
---
 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



More information about the stable mailing list