summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2018-05-25 12:06:27 +0300
committerChristoph Hellwig <hch@lst.de>2018-05-25 17:50:12 +0300
commit75c8b19a23100455339af947e032f1a221344c68 (patch)
treefdf6b0d0f57d6b163dd4fcb32f27b864bd877dcd /drivers
parent1e5f44616287b24a2c032274d6a5e3690dfd279b (diff)
downloadlinux-75c8b19a23100455339af947e032f1a221344c68.tar.xz
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 'drivers')
-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) {