Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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 <rakesh@tuxera.com>
Reviewed-by: default avatarJavier González <javier@cnexlabs.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent ebd76857
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 */