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

lightnvm: pblk: fix double-free on pblk init

Prevent pblk->lines being double freed in case of an error during pblk
initialization.

Fixes: dd2a4343: "lightnvm: pblk: sched. metadata on write thread"
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
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@kernel.dk>
parent f417aa0b
...@@ -812,8 +812,6 @@ static int pblk_lines_init(struct pblk *pblk) ...@@ -812,8 +812,6 @@ static int pblk_lines_init(struct pblk *pblk)
fail_free_lines: fail_free_lines:
while (--i >= 0) while (--i >= 0)
pblk_free_line_bitmaps(&pblk->lines[i]); pblk_free_line_bitmaps(&pblk->lines[i]);
kfree(pblk->lines);
fail_free_bb_aux: fail_free_bb_aux:
kfree(l_mg->bb_aux); kfree(l_mg->bb_aux);
fail_free_bb_template: fail_free_bb_template:
......
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