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: a4bd217b ("lightnvm: physical block device (pblk) target") Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com> Reviewed-by: NJavier González <javier@cnexlabs.com> Signed-off-by: NJens Axboe <axboe@fb.com>
Showing
想要评论请 注册 或 登录