summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-04-30 09:32:48 -0600
committerJens Axboe <axboe@kernel.dk>2020-04-30 09:32:48 -0600
commit47ed39e0625d3a47b6d6c0a12942b62fb802298f (patch)
tree6bc279c67a6338e21deba9bc13f4d6e90bb5ec79
parentd205bde78fa53e1ce256b1f7f65ede9696d73ee5 (diff)
parent132be62387c7a72a38872676c18b0dfae264adb8 (diff)
Merge branch 'nvme-5.7' of git://git.infradead.org/nvme into block-5.7
Pull NVMe fix from Christoph. * 'nvme-5.7' of git://git.infradead.org/nvme: nvme: prevent double free in nvme_alloc_ns() error handling
-rw-r--r--drivers/nvme/host/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 91c1bd659947..f2adea96b04c 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3642,6 +3642,8 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
return;
out_put_disk:
+ /* prevent double queue cleanup */
+ ns->disk->queue = NULL;
put_disk(ns->disk);
out_unlink_ns:
mutex_lock(&ctrl->subsys->lock);