commit | 7f7c5d03c0e8e177d1ed1c6412ae035e8eff35de | [log] [tgz] |
---|---|---|
author | Matias Bjørling <m@bjorling.me> | Fri May 06 20:02:59 2016 +0200 |
committer | Jens Axboe <axboe@fb.com> | Fri May 06 12:51:10 2016 -0600 |
tree | 1a354500001df077c63e14ba63c29fc43d375fcf | |
parent | 22e8c9766a669d49cf3749d397082a5cd93374a9 [diff] |
lightnvm: avoid memory leak when lun_map kcalloc fails A memory leak occurs if the lower page table is initialized and the following dev->lun_map fails on allocation. Rearrange the initialization of lower page table to allow dev->lun_map to fail gracefully without memory leak. Reviewed by: Johannes Thumshirn <jthumshirn@suse.de> Move kfree of dev->lun_map to nvm_free() Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>