diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c index e6d974eaf1..324ea640c2 100644 --- a/lib/bdev/bdev.c +++ b/lib/bdev/bdev.c @@ -1172,8 +1172,8 @@ _spdk_bdev_channel_destroy_resource(struct spdk_bdev_channel *ch) shared_resource->ref--; if (shared_resource->ref == 0) { assert(shared_resource->io_outstanding == 0); - spdk_put_io_channel(spdk_io_channel_from_ctx(shared_resource->mgmt_ch)); TAILQ_REMOVE(&shared_resource->mgmt_ch->shared_resources, shared_resource, link); + spdk_put_io_channel(spdk_io_channel_from_ctx(shared_resource->mgmt_ch)); free(shared_resource); } }