mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
lightnvm: pblk: fix resource leak of invalid_bitmap
Currently the error exit path when the emeta could not be
interpreted is via fail_free_ws and this fails to free
invalid_bitmap. Fix this by adding another exit label and
exiting via this to kfree invalid_bitmap.
Detected by CoverityScan, CID#1469659 ("Resource leak")
Fixes: 48b8d20895
("lightnvm: pblk: garbage collect lines with failed writes")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
21ff1399ad
commit
0ec6937e8e
1 changed files with 2 additions and 1 deletions
|
@ -203,7 +203,7 @@ static void pblk_gc_line_prepare_ws(struct work_struct *work)
|
||||||
if (!lba_list) {
|
if (!lba_list) {
|
||||||
pr_err("pblk: could not interpret emeta (line %d)\n",
|
pr_err("pblk: could not interpret emeta (line %d)\n",
|
||||||
line->id);
|
line->id);
|
||||||
goto fail_free_ws;
|
goto fail_free_invalid_bitmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,6 +280,7 @@ static void pblk_gc_line_prepare_ws(struct work_struct *work)
|
||||||
kfree(gc_rq);
|
kfree(gc_rq);
|
||||||
fail_free_lba_list:
|
fail_free_lba_list:
|
||||||
pblk_mfree(lba_list, l_mg->emeta_alloc_type);
|
pblk_mfree(lba_list, l_mg->emeta_alloc_type);
|
||||||
|
fail_free_invalid_bitmap:
|
||||||
kfree(invalid_bitmap);
|
kfree(invalid_bitmap);
|
||||||
fail_free_ws:
|
fail_free_ws:
|
||||||
kfree(line_ws);
|
kfree(line_ws);
|
||||||
|
|
Loading…
Reference in a new issue