Commit 6a03cd98 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

loop: fix order of cleaning up the queue and freeing the tagset

We must release the queue before freeing the tagset.

Fixes: 1c99502f ("loop: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-by: default avatarBruno Goncalves <bgoncalv@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 07a719f8
......@@ -2183,8 +2183,8 @@ static int loop_add(struct loop_device **l, int i)
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment