[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32afa408-0968-2d1a-5add-593907636592@amd.com>
Date: Fri, 4 Oct 2019 11:00:15 +0000
From: Nirmoy <nirmodas@....com>
To: "Koenig, Christian" <Christian.Koenig@....com>,
Nirmoy Das <nirmoy.aiemd@...il.com>,
"Deucher, Alexander" <Alexander.Deucher@....com>
CC: "airlied@...ux.ie" <airlied@...ux.ie>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Das, Nirmoy" <Nirmoy.Das@....com>
Subject: Re: [PATCH] drm/amdgpu: fix memory leak
On 10/4/19 12:44 PM, Koenig, Christian wrote:
> First of all please send mails regarding amdgpu to the amd-gfx mailing
> list and not lkml/dri-devel.
Okay.
> Am 04.10.19 um 12:17 schrieb Nirmoy Das:
>> In amdgpu_bo_list_ioctl when idr_alloc fails
>> don't return without freeing bo list entry.
>>
>> Fixes: 964d0fbf6301d ("drm/amdgpu: Allow to create BO lists in CS ioctl v3")
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@....com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
>> index 7bcf86c61999..c3e5ea544857 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
>> @@ -284,7 +284,7 @@ int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data,
>> mutex_unlock(&fpriv->bo_list_lock);
>> if (r < 0) {
>> amdgpu_bo_list_put(list);
>> - return r;
>> + goto error_free;
> NAK, that is a double free. The bo list entries are freed by
> amdgpu_bo_list_put().
Thanks, didn't realize that.
> Regards,
> Christian.
Regards,
Nirmoy
>> }
>>
>> handle = r;
Powered by blists - more mailing lists