* [PATCH] drm/amdgpu: release allocated memory
@ 2019-09-20 22:49 Navid Emamdoost
2019-09-21 11:32 ` Koenig, Christian
0 siblings, 1 reply; 2+ messages in thread
From: Navid Emamdoost @ 2019-09-20 22:49 UTC (permalink / raw)
Cc: emamd001, smccaman, kjlu, Navid Emamdoost, Alex Deucher,
Christian König, David (ChunMing) Zhou, David Airlie,
Daniel Vetter, Sam Ravnborg, Rex Zhu, amd-gfx, dri-devel,
linux-kernel
In amdgpu_vmid_grab_idle, fences is being leaked in one execution path.
The missing kfree was added.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c
index 57b3d8a9bef3..9063cd36fa94 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c
@@ -244,6 +244,7 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm,
r = amdgpu_sync_fence(adev, sync, &array->base, false);
dma_fence_put(ring->vmid_wait);
ring->vmid_wait = &array->base;
+ kfree(fences);
return r;
}
kfree(fences);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amdgpu: release allocated memory
2019-09-20 22:49 [PATCH] drm/amdgpu: release allocated memory Navid Emamdoost
@ 2019-09-21 11:32 ` Koenig, Christian
0 siblings, 0 replies; 2+ messages in thread
From: Koenig, Christian @ 2019-09-21 11:32 UTC (permalink / raw)
To: Navid Emamdoost
Cc: emamd001, smccaman, kjlu, Deucher, Alexander, Zhou,
David(ChunMing),
David Airlie, Daniel Vetter, Sam Ravnborg, Rex Zhu, amd-gfx,
dri-devel, linux-kernel
Am 21.09.19 um 00:49 schrieb Navid Emamdoost:
> In amdgpu_vmid_grab_idle, fences is being leaked in one execution path.
> The missing kfree was added.
NAK, the array is freed by the dma_fence_array. This is a double free.
Regards,
Christian.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c
> index 57b3d8a9bef3..9063cd36fa94 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c
> @@ -244,6 +244,7 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm,
> r = amdgpu_sync_fence(adev, sync, &array->base, false);
> dma_fence_put(ring->vmid_wait);
> ring->vmid_wait = &array->base;
> + kfree(fences);
> return r;
> }
> kfree(fences);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-21 11:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 22:49 [PATCH] drm/amdgpu: release allocated memory Navid Emamdoost
2019-09-21 11:32 ` Koenig, Christian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).