From: Javier González Date: Fri, 30 Jun 2017 15:56:35 +0000 (+0200) Subject: lightnvm: pblk: fix double-free on pblk init X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2950e7e61089de0e7058fdf04a53d25e078f2230;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git lightnvm: pblk: fix double-free on pblk init 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 Signed-off-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 8bdaf7e0e00b..b3fc310aa51c 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -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: