summaryrefslogtreecommitdiff
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2017-01-31 15:17:19 +0300
committerJens Axboe <axboe@fb.com>2017-01-31 18:32:13 +0300
commitdeccf5a52ea59843f5575cb49fe532c7cb8801e4 (patch)
treedf3f3a3bcd511def21dcd451cde36c002f1b4ceb /drivers/lightnvm
parent38ea2f7656f815e7330868cbec7bada0fd7933a8 (diff)
downloadlinux-deccf5a52ea59843f5575cb49fe532c7cb8801e4.tar.xz
lightnvm: free properly on target creation error
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@cnexlabs.com> Signed-off-by: Matias Bjørling <matias@cnexlabs.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r--drivers/lightnvm/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 4f4db991c4a6..b2cd3d6f2a31 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -303,7 +303,7 @@ err_init:
err_queue:
blk_cleanup_queue(tqueue);
err_dev:
- kfree(tgt_dev);
+ nvm_remove_tgt_dev(tgt_dev);
err_t:
kfree(t);
err_reserve: