Skip to content

Commit

Permalink
lightnvm: pblk: fix double-free on pblk init
Browse files Browse the repository at this point in the history
Prevent pblk->lines being double freed in case of an error during pblk
initialization.

Fixes: dd2a434: "lightnvm: pblk: sched. metadata on write thread"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Javier González authored and Jens Axboe committed Jun 30, 2017
1 parent f417aa0 commit 2950e7e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/lightnvm/pblk-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,6 @@ static int pblk_lines_init(struct pblk *pblk)
fail_free_lines:
while (--i >= 0)
pblk_free_line_bitmaps(&pblk->lines[i]);

kfree(pblk->lines);
fail_free_bb_aux:
kfree(l_mg->bb_aux);
fail_free_bb_template:
Expand Down

0 comments on commit 2950e7e

Please sign in to comment.