]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: fix possible memory leak in pblk_bb_discovery()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 25 Apr 2017 16:15:30 +0000 (16:15 +0000)
committerJens Axboe <axboe@fb.com>
Tue, 25 Apr 2017 16:44:29 +0000 (10:44 -0600)
commit5564466fa863ef528b159a3464657a09c422d374
tree0797e62df77407cf16ff995ab1d2d2d008fd45a0
parent43a7cc40618252b128ba3265e49fdb38a6aa135d
lightnvm: fix possible memory leak in pblk_bb_discovery()

'blks' is malloced in pblk_bb_discovery() and should be freed
before leaving from the nvm_get_tgt_bb_tbl() error handling cases,
otherwise it will cause memory leak. Also skip assign blks to
rlun->bb_list when error.

Fixes: 8c1395d19245 ("lightnvm: physical block device (pblk) target")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/pblk-init.c