summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWang Qing <wangqing@vivo.com>2021-07-06 12:00:16 +0800
committerJens Axboe <axboe@kernel.dk>2021-07-15 09:30:15 -0600
commit16ad3db3b24cd9f70aa24e93cef0d4a83dece7ac (patch)
tree49da5b9578289304a3cad3a87798cc47568ad2f9 /drivers
parent58b63e0f556c2debb8c942abcc9e6beadc4a07f0 (diff)
nbd: fix order of cleaning up the queue and freeing the tagset
We must release the queue before freeing the tagset. Fixes: 4af5f2e03013 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk") Reported-and-tested-by: syzbot+9ca43ff47167c0ee3466@syzkaller.appspotmail.com Signed-off-by: Wang Qing <wangqing@vivo.com> Signed-off-by: Guoqing Jiang <jiangguoqing@kylinos.cn> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210706040016.1360412-1-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/nbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index b7d663736d35..c38317979f74 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -239,8 +239,8 @@ static void nbd_dev_remove(struct nbd_device *nbd)
if (disk) {
del_gendisk(disk);
- blk_mq_free_tag_set(&nbd->tag_set);
blk_cleanup_disk(disk);
+ blk_mq_free_tag_set(&nbd->tag_set);
}
/*