mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
lightnvm: pblk: fix error handling of pblk_lines_init()
In the too many bad blocks error handling case, we should release all
the allocated resources, otherwise it will cause memory leak.
Fixes: 2deeefc02d ("lightnvm: pblk: fail gracefully on line alloc. failure")
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Hans Holmberg <[email protected]>
Signed-off-by: Matias Bjørling <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
6fd05cad5e
commit
a70985f83c
1 changed files with 2 additions and 1 deletions
|
|
@ -1024,7 +1024,8 @@ static int pblk_lines_init(struct pblk *pblk)
|
|||
|
||||
if (!nr_free_chks) {
|
||||
pblk_err(pblk, "too many bad blocks prevent for sane instance\n");
|
||||
return -EINTR;
|
||||
ret = -EINTR;
|
||||
goto fail_free_lines;
|
||||
}
|
||||
|
||||
pblk_set_provision(pblk, nr_free_chks);
|
||||
|
|
|
|||
Loading…
Reference in a new issue