Skip to content

Commit

Permalink
loop: fix order of cleaning up the queue and freeing the tagset
Browse files Browse the repository at this point in the history
We must release the queue before freeing the tagset.

Fixes: 1c99502 ("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>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jun 16, 2021
1 parent 07a719f commit 6a03cd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6a03cd9

Please sign in to comment.