Commit deccf5a5 authored by Javier González's avatar Javier González Committed by Jens Axboe

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: default avatarJavier González <javier@cnexlabs.com>
Signed-off-by: default avatarMatias Bjørling <matias@cnexlabs.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 38ea2f76
...@@ -303,7 +303,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create) ...@@ -303,7 +303,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
err_queue: err_queue:
blk_cleanup_queue(tqueue); blk_cleanup_queue(tqueue);
err_dev: err_dev:
kfree(tgt_dev); nvm_remove_tgt_dev(tgt_dev);
err_t: err_t:
kfree(t); kfree(t);
err_reserve: err_reserve:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment