lkml.org 
[lkml]   [2017]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] nvme: lightnvm: fix memory leak
From
Date
On 05/09/2017 07:59 AM, Javier González wrote:
>> On 9 May 2017, at 15.55, Rakesh Pandit <rakesh@tuxera.com> wrote:
>>
>> 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>
>> ---
>> drivers/nvme/host/lightnvm.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
>> index 206bfdb..f5df78e 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 */
>> --
>> 2.5.5
>
> Looks good. Thanks Rakesh.
>
> Reviewed-by: Javier González <javier@cnexlabs.com>

Added for this series.

--
Jens Axboe

\
 
 \ /
  Last update: 2017-05-10 21:18    [W:0.043 / U:10.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site