summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorHannes Reinecke2019-01-08 12:46:58 +0100
committerGreg Kroah-Hartman2019-02-20 10:25:41 +0100
commit6c27b5230e356ce2f4e259bef17a78864510d7ba (patch)
tree0038c89e31f4240d9a698211d31e4474d6244e74 /drivers/nvme
parentnvme-pci: fix out of bounds access in nvme_cqe_pending (diff)
downloadkernel-qcow2-linux-6c27b5230e356ce2f4e259bef17a78864510d7ba.tar.gz
kernel-qcow2-linux-6c27b5230e356ce2f4e259bef17a78864510d7ba.tar.xz
kernel-qcow2-linux-6c27b5230e356ce2f4e259bef17a78864510d7ba.zip
nvme-multipath: zero out ANA log buffer
[ Upstream commit c7055fd15ff46d92eb0dd1c16a4fe010d58224c8 ] When nvme_init_identify() fails the ANA log buffer is deallocated but _not_ set to NULL. This can cause double free oops when this controller is deleted without ever being reconnected. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/multipath.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index c27af277e14e..815509dbed84 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -556,6 +556,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
return 0;
out_free_ana_log_buf:
kfree(ctrl->ana_log_buf);
+ ctrl->ana_log_buf = NULL;
out:
return error;
}
@@ -563,5 +564,6 @@ out:
void nvme_mpath_uninit(struct nvme_ctrl *ctrl)
{
kfree(ctrl->ana_log_buf);
+ ctrl->ana_log_buf = NULL;
}