Commit fba704b4 authored by Rakesh Pandit's avatar Rakesh Pandit Committed by Jens Axboe

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: default avatarRakesh Pandit <>
Reviewed-by: default avatarJavier González <>
Signed-off-by: default avatarJens Axboe <>
parent ebd76857
......@@ -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 */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment