summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-06-16 09:15:47 +0200
committerJens Axboe <axboe@kernel.dk>2021-06-16 14:53:51 +0200
commit6a03cd9843fa4dcf827dc3ad60fa9b4217f3057c (patch)
treeac4f47b663b2134ecade6e6657f7625c82691591
parentmtd_blkdevs: initialze new->rq in add_mtd_blktrans_dev (diff)
downloadlinux-6a03cd9843fa4dcf827dc3ad60fa9b4217f3057c.tar.xz
linux-6a03cd9843fa4dcf827dc3ad60fa9b4217f3057c.zip
loop: fix order of cleaning up the queue and freeing the tagset
We must release the queue before freeing the tagset. Fixes: 1c99502fae35 ("loop: use blk_mq_alloc_disk and blk_cleanup_disk") Reported-by: Bruno Goncalves <bgoncalv@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/block/loop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 3f40e673a101..e90f7d349816 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -2183,8 +2183,8 @@ out:
static void loop_remove(struct loop_device *lo)
{
del_gendisk(lo->lo_disk);
- blk_mq_free_tag_set(&lo->tag_set);
blk_cleanup_disk(lo->lo_disk);
+ blk_mq_free_tag_set(&lo->tag_set);
mutex_destroy(&lo->lo_mutex);
kfree(lo);
}