diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2017-02-27 17:44:45 +0100 |
---|---|---|
committer | Sagi Grimberg <sagi@grimberg.me> | 2017-03-16 17:41:17 +0100 |
commit | e4c5d3762e2d6d274bd1cc948c47063becfa2103 (patch) | |
tree | a4fce8dbb95558ffd1de0124ea8d4f4f5821c206 /drivers/nvme | |
parent | blk-stat: fix blk_stat_sum() if all samples are batched (diff) | |
download | linux-e4c5d3762e2d6d274bd1cc948c47063becfa2103.tar.xz linux-e4c5d3762e2d6d274bd1cc948c47063becfa2103.zip |
nvme-loop: fix a possible use-after-free when destroying the admin queue
we need to destroy the nvmet sq and let it finish gracefully
before continue to cleanup the queue.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/loop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index d1f06e7768ff..74e04a0855d4 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -288,9 +288,9 @@ static struct blk_mq_ops nvme_loop_admin_mq_ops = { static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl) { + nvmet_sq_destroy(&ctrl->queues[0].nvme_sq); blk_cleanup_queue(ctrl->ctrl.admin_q); blk_mq_free_tag_set(&ctrl->admin_tag_set); - nvmet_sq_destroy(&ctrl->queues[0].nvme_sq); } static void nvme_loop_free_ctrl(struct nvme_ctrl *nctrl) |