aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/core.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2018-05-25 11:06:27 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-25 16:50:12 +0200
commit75c8b19a23100455339af947e032f1a221344c68 (patch)
treefdf6b0d0f57d6b163dd4fcb32f27b864bd877dcd /drivers/nvme/host/core.c
parentnvme: fix KASAN warning when parsing host nqn (diff)
downloadlinux-dev-75c8b19a23100455339af947e032f1a221344c68.tar.xz
linux-dev-75c8b19a23100455339af947e032f1a221344c68.zip
nvme: fixup memory leak in nvme_init_identify()
If nvme_get_effects_log() failed the 'id' buffer from the previous nvme_identify_ctrl() call will never be freed. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to '')
-rw-r--r--drivers/nvme/host/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index fd206a6adad5..2c4cf65641a6 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2316,7 +2316,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
if (id->lpa & NVME_CTRL_LPA_CMD_EFFECTS_LOG) {
ret = nvme_get_effects_log(ctrl);
if (ret < 0)
- return ret;
+ goto out_free;
}
if (!ctrl->identified) {