mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-20 17:41:09 +00:00
lightnvm: fix memory leak when submit fails
commit9778448175
upstream. The allocated page is not released if error occurs in nvm_submit_io_sync_raw(). __free_page() is moved ealier to avoid possible memory leak issue. Fixes:aff3fb18f9
("lightnvm: move bad block and chunk state logic to core") Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
76e2b0b65d
commit
73171b677f
1 changed files with 1 additions and 2 deletions
|
@ -844,11 +844,10 @@ static int nvm_bb_chunk_sense(struct nvm_dev *dev, struct ppa_addr ppa)
|
|||
rqd.ppa_addr = generic_to_dev_addr(dev, ppa);
|
||||
|
||||
ret = nvm_submit_io_sync_raw(dev, &rqd);
|
||||
__free_page(page);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
__free_page(page);
|
||||
|
||||
return rqd.error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue