nvme: lightnvm: fix memory leak

Free up kmalloc allocated memory if failure happens while handling L2P
table transfer in nvme_nvm_get_l2p_tbl.

Fixes: 8e79b5cb ("lightnvm: move block provisioning to targets")
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Rakesh Pandit 2017-05-09 08:48:25 -06:00 committed by Jens Axboe
parent ebd7685795
commit fba704b494
1 changed files with 2 additions and 1 deletions

View File

@ -367,7 +367,8 @@ static int nvme_nvm_get_l2p_tbl(struct nvm_dev *nvmdev, u64 slba, u32 nlb,
if (unlikely(elba > nvmdev->total_secs)) {
pr_err("nvm: L2P data from device is out of bounds!\n");
return -EINVAL;
ret = -EINVAL;
goto out;
}
/* Transform physical address to target address space */