<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Maybe add a comment here in the code to avoid confusion in the future.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Koenig, Christian <Christian.Koenig@amd.com><br>
<b>Sent:</b> Saturday, September 21, 2019 7:32 AM<br>
<b>To:</b> Navid Emamdoost <navid.emamdoost@gmail.com><br>
<b>Cc:</b> emamd001@umn.edu <emamd001@umn.edu>; smccaman@umn.edu <smccaman@umn.edu>; kjlu@umn.edu <kjlu@umn.edu>; Deucher, Alexander <Alexander.Deucher@amd.com>; Zhou, David(ChunMing) <David1.Zhou@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch>;
 Sam Ravnborg <sam@ravnborg.org>; Rex Zhu <Rex.Zhu@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: release allocated memory</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Am 21.09.19 um 00:49 schrieb Navid Emamdoost:<br>
> In amdgpu_vmid_grab_idle, fences is being leaked in one execution path.<br>
> The missing kfree was added.<br>
<br>
NAK, the array is freed by the dma_fence_array.  This is a double free.<br>
<br>
Regards,<br>
Christian.<br>
<br>
><br>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com><br>
> ---<br>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 1 +<br>
>   1 file changed, 1 insertion(+)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c<br>
> index 57b3d8a9bef3..9063cd36fa94 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c<br>
> @@ -244,6 +244,7 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm,<br>
>                r = amdgpu_sync_fence(adev, sync, &array->base, false);<br>
>                dma_fence_put(ring->vmid_wait);<br>
>                ring->vmid_wait = &array->base;<br>
> +             kfree(fences);<br>
>                return r;<br>
>        }<br>
>        kfree(fences);<br>
<br>
</div>
</span></font></div>
</body>
</html>