From: Hannes Reinecke Date: Fri, 25 May 2018 09:06:27 +0000 (+0200) Subject: nvme: fixup memory leak in nvme_init_identify() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=75c8b19a23100455339af947e032f1a221344c68;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig --- 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) {