提交 a70985f8 编写于 作者: W Wei Yongjun 提交者: Jens Axboe

lightnvm: pblk: fix error handling of pblk_lines_init()

In the too many bad blocks error handling case, we should release all
the allocated resources, otherwise it will cause memory leak.

Fixes: 2deeefc0 ("lightnvm: pblk: fail gracefully on line alloc. failure")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: NHans Holmberg <hans.holmberg@cnexlabs.com>
Signed-off-by: NMatias Bjørling <mb@lightnvm.io>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 6fd05cad
......@@ -1024,7 +1024,8 @@ static int pblk_lines_init(struct pblk *pblk)
if (!nr_free_chks) {
pblk_err(pblk, "too many bad blocks prevent for sane instance\n");
return -EINTR;
ret = -EINTR;
goto fail_free_lines;
}
pblk_set_provision(pblk, nr_free_chks);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册