summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-07-20 15:05:40 +0200
committerJens Axboe <axboe@kernel.dk>2022-07-21 18:59:02 +0200
commit0a3e5cc7bbfcd571a2e53779ef7d7aa3c57d5432 (patch)
tree3b3159f26c2fa8841002648be5d01366b09b1923 /block/blk-mq.c
parentublk: defer disk allocation (diff)
downloadlinux-0a3e5cc7bbfcd571a2e53779ef7d7aa3c57d5432.tar.xz
linux-0a3e5cc7bbfcd571a2e53779ef7d7aa3c57d5432.zip
blk-mq: fix error handling in __blk_mq_alloc_disk
To fully clean up the queue if the disk allocation fails we need to call blk_mq_destroy_queue and not just blk_put_queue. Fixes: 6f8191fdf41d ("block: simplify disk shutdown") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20220720130541.1323531-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index d716b7f3763f..70177ee74295 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3960,7 +3960,7 @@ struct gendisk *__blk_mq_alloc_disk(struct blk_mq_tag_set *set, void *queuedata,
disk = __alloc_disk_node(q, set->numa_node, lkclass);
if (!disk) {
- blk_put_queue(q);
+ blk_mq_destroy_queue(q);
return ERR_PTR(-ENOMEM);
}
set_bit(GD_OWNS_QUEUE, &disk->state);