Re: [PATCH -next] lightnvm: fix possible memory leak in pblk_bb_discovery()

Javier González
2017-04-25T16:40:45Z

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

> On 25 Apr 2017, at 18.15, Wei Yongjun <weiyj.lk@gmail.com> wrote:
>
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> '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: a4bd217b4326 ("lightnvm: physical block device (pblk) target")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>

Thanks Wei. Looks good.

Reviewed-by: Javier González <javier@cnexlabs.com>

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 801 bytes --]