]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: fix memory leak when submit fails
authorPan Bian <bianpan2016@163.com>
Thu, 21 Jan 2021 07:22:02 +0000 (23:22 -0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Jan 2021 12:45:51 +0000 (05:45 -0700)
commitcbaf67627bbee57b6da802a1fb320b3f54f05746
treeccee7ca08a90a00af966d2a6a87d862b2dd32519
parent63a37ebae6d1032954623974550297b0f1a9e64a
lightnvm: fix memory leak when submit fails

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: 4f4fbc7683d3 ("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>
drivers/lightnvm/core.c