summaryrefslogtreecommitdiffstats
path: root/block/bsg-lib.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-10-18 15:57:17 +0200
committerJens Axboe <axboe@kernel.dk>2022-10-25 16:25:10 +0200
commit2b3f056f72e56fa07df69b4705e0b46a6c08e77c (patch)
treecbff7730308b378de7bc8e3ac7076195404f9be4 /block/bsg-lib.c
parentblock: fix up elevator_type refcounting (diff)
downloadlinux-2b3f056f72e56fa07df69b4705e0b46a6c08e77c.tar.xz
linux-2b3f056f72e56fa07df69b4705e0b46a6c08e77c.zip
blk-mq: move the call to blk_put_queue out of blk_mq_destroy_queue
The fact that blk_mq_destroy_queue also drops a queue reference leads to various places having to grab an extra reference. Move the call to blk_put_queue into the callers to allow removing the extra references. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Link: https://lore.kernel.org/r/20221018135720.670094-2-hch@lst.de [axboe: fix fabrics_q vs admin_q conflict in nvme core.c] Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bsg-lib.c')
-rw-r--r--block/bsg-lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/bsg-lib.c b/block/bsg-lib.c
index d6f5dcdce748..435c32373cd6 100644
--- a/block/bsg-lib.c
+++ b/block/bsg-lib.c
@@ -325,6 +325,7 @@ void bsg_remove_queue(struct request_queue *q)
bsg_unregister_queue(bset->bd);
blk_mq_destroy_queue(q);
+ blk_put_queue(q);
blk_mq_free_tag_set(&bset->tag_set);
kfree(bset);
}
@@ -400,6 +401,7 @@ struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
return q;
out_cleanup_queue:
blk_mq_destroy_queue(q);
+ blk_put_queue(q);
out_queue:
blk_mq_free_tag_set(set);
out_tag_set: