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

* [PATCH] nvme: fixup memory leak in nvme_init_identify()
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2018-05-25  9:53 UTC (permalink / raw)


Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

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

* [PATCH] nvme: fixup memory leak in nvme_init_identify()
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2018-05-25 13:48 UTC (permalink / raw)


Thanks,

applied to nvme-4.18-2.

^ permalink raw reply	[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.