diff --git a/lib/bdev/crypto/vbdev_crypto.c b/lib/bdev/crypto/vbdev_crypto.c index 8ffed5424..39b3e88c0 100644 --- a/lib/bdev/crypto/vbdev_crypto.c +++ b/lib/bdev/crypto/vbdev_crypto.c @@ -1345,6 +1345,7 @@ vbdev_crypto_finish(void) struct vbdev_dev *device; struct device_qp *dev_qp; unsigned i; + int rc; while ((name = TAILQ_FIRST(&g_bdev_names))) { TAILQ_REMOVE(&g_bdev_names, name, link); @@ -1369,9 +1370,12 @@ vbdev_crypto_finish(void) rte_dev->dev_ops->queue_pair_release(rte_dev, i); } } - free(device); } + rc = rte_vdev_uninit(AESNI_MB); + if (rc) { + SPDK_ERRLOG("%d from rte_vdev_uninit\n", rc); + } while ((dev_qp = TAILQ_FIRST(&g_device_qp))) { TAILQ_REMOVE(&g_device_qp, dev_qp, link); diff --git a/test/unit/lib/bdev/crypto.c/crypto_ut.c b/test/unit/lib/bdev/crypto.c/crypto_ut.c index fdf8d8de4..792fb38d7 100644 --- a/test/unit/lib/bdev/crypto.c/crypto_ut.c +++ b/test/unit/lib/bdev/crypto.c/crypto_ut.c @@ -202,6 +202,7 @@ DEFINE_STUB(rte_cryptodev_sym_session_init, int, (uint8_t dev_id, struct rte_crypto_sym_xform *xforms, struct rte_mempool *mempool), 0); DEFINE_STUB(rte_vdev_init, int, (const char *name, const char *args), 0); DEFINE_STUB(rte_cryptodev_sym_session_free, int, (struct rte_cryptodev_sym_session *sess), 0); +DEFINE_STUB(rte_vdev_uninit, int, (const char *name), 0); struct rte_cryptodev *rte_cryptodevs;