summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorRakesh Pandit <rakesh@tuxera.com>2017-05-09 16:48:25 +0200
committerJens Axboe <axboe@fb.com>2017-05-10 15:39:43 +0200
commitfba704b494fdc6816a039a66887274b4e5c00eeb (patch)
treed86d13909a28d2686e6154550b9184619d0524ad /drivers/nvme
parentblk-mq: make __blk_mq_stop_hw_queues static (diff)
downloadlinux-fba704b494fdc6816a039a66887274b4e5c00eeb.tar.xz
linux-fba704b494fdc6816a039a66887274b4e5c00eeb.zip
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>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/lightnvm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 206bfdbc1c98..f5df78ed1e10 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -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 */