From 126c22020a078fec270f15e2f768d8bf88872494 Mon Sep 17 00:00:00 2001 From: Paul Luse Date: Mon, 12 Nov 2018 17:05:22 -0700 Subject: [PATCH] bdev/crypto: unregister io_device on failure in examine callback In vbdev_crypto_examine() we were failing to unregsiter the io_device in the event that spdk_vbdev_register() call failed. Found via inspection. Change-Id: I73c6c0c5693777b93c1ea02dcf2e2e65d46fe27d Signed-off-by: Paul Luse Reviewed-on: https://review.gerrithub.io/432933 (master) Reviewed-on: https://review.gerrithub.io/435677 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Chandler-Test-Pool: SPDK Automated Test System --- lib/bdev/crypto/vbdev_crypto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/bdev/crypto/vbdev_crypto.c b/lib/bdev/crypto/vbdev_crypto.c index 93563d7754..a4704ed1bb 100644 --- a/lib/bdev/crypto/vbdev_crypto.c +++ b/lib/bdev/crypto/vbdev_crypto.c @@ -1589,6 +1589,7 @@ vbdev_crypto_examine(struct spdk_bdev *bdev) SPDK_ERRLOG("could not register crypto_bdev\n"); spdk_bdev_close(crypto_bdev->base_desc); TAILQ_REMOVE(&g_vbdev_crypto, crypto_bdev, link); + spdk_io_device_unregister(crypto_bdev, NULL); free(crypto_bdev->crypto_bdev.name); free(crypto_bdev->key); free(crypto_bdev);