[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170131121720.10971-12-matias@cnexlabs.com>
Date: Tue, 31 Jan 2017 13:17:19 +0100
From: Matias Bjørling <matias@...xlabs.com>
To: <axboe@...com>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Javier González <jg@...htnvm.io>,
Javier González <javier@...xlabs.com>,
Matias Bjørling <matias@...xlabs.com>
Subject: [PATCH 11/12] lightnvm: free properly on target creation error
From: Javier González <jg@...htnvm.io>
Fix a memory leak when target creation fails. More specifically, free
the entire device structure given to the target (tgt_dev).
Signed-off-by: Javier González <javier@...xlabs.com>
Signed-off-by: Matias Bjørling <matias@...xlabs.com>
---
drivers/lightnvm/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 4f4db99..b2cd3d6 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -303,7 +303,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
err_queue:
blk_cleanup_queue(tqueue);
err_dev:
- kfree(tgt_dev);
+ nvm_remove_tgt_dev(tgt_dev);
err_t:
kfree(t);
err_reserve:
--
2.9.3
Powered by blists - more mailing lists