All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-loop: kfree(ctrl) on _create() error exit
@ 2016-10-26 20:20 Jay Freyensee
  2016-10-27 12:13 ` Sagi Grimberg
  2016-10-27 12:49 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Jay Freyensee @ 2016-10-26 20:20 UTC (permalink / raw)


ctrl is kzalloc'ed but looks like it's never kfree'ed
on the goto exit cases on nvme_loop_create_ctrl().

Signed-off-by: Jay Freyensee <james_p_freyensee at linux.intel.com>
---
 drivers/nvme/target/loop.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index d5df77d..b0f9931 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -673,6 +673,7 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev,
 	nvme_uninit_ctrl(&ctrl->ctrl);
 out_put_ctrl:
 	nvme_put_ctrl(&ctrl->ctrl);
+	kfree(ctrl);
 	if (ret > 0)
 		ret = -EIO;
 	return ERR_PTR(ret);
-- 
2.7.4

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

end of thread, other threads:[~2016-10-30  6:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-26 20:20 [PATCH] nvme-loop: kfree(ctrl) on _create() error exit Jay Freyensee
2016-10-27 12:13 ` Sagi Grimberg
2016-10-27 12:49 ` Christoph Hellwig
2016-10-27 15:40   ` J Freyensee
2016-10-27 16:00     ` Christoph Hellwig
2016-10-30  6:48       ` Sagi Grimberg

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.