lightnvm: pblk: fix double-free on pblk init
authorJavier González <jg@lightnvm.io>
Fri, 30 Jun 2017 15:56:35 +0000 (17:56 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 30 Jun 2017 17:08:18 +0000 (11:08 -0600)
Prevent pblk->lines being double freed in case of an error during pblk
initialization.

Fixes: dd2a43437337: "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>
drivers/lightnvm/pblk-init.c

index 8bdaf7e0e00b36f74080b72d9a878e45e5618632..b3fc310aa51c1a1ce6a8b0ae2c447e0756189ada 100644 (file)
@@ -812,8 +812,6 @@ add_emeta_page:
 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: