All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: fixup memory leak in nvme_init_identify()
@ 2018-05-25  9:06 Hannes Reinecke
  2018-05-25  9:53 ` Johannes Thumshirn
  2018-05-25 13:48 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Hannes Reinecke @ 2018-05-25  9:06 UTC (permalink / raw)


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 at suse.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 62262fac7a5d..79d49f16d991 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2314,7 +2314,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) {
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-25 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-25  9:06 [PATCH] nvme: fixup memory leak in nvme_init_identify() Hannes Reinecke
2018-05-25  9:53 ` Johannes Thumshirn
2018-05-25 13:48 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.