[PATCH] drm/amdgpu: fix userq resource double freed
Christian König
christian.koenig at amd.com
Wed May 14 07:02:14 UTC 2025
On 5/12/25 09:30, Prike Liang wrote:
> As the userq resource was already freed at the drm_release
> early phase, it should avoid freeing userq resource again
> at the later kms postclose callback.
Clear NAK. You are just hiding a bug.
The userq resources should always be only cleaned up here and that function can't be called twice.
Regards,
Christian.
>
> Signed-off-by: Prike Liang <Prike.Liang at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 8d4a2aed7231..cf0f35a7daee 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -1502,10 +1502,11 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
> amdgpu_bo_unreserve(pd);
> }
>
> - fpriv->evf_mgr.fd_closing = true;
> - amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
> - amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
> -
> + if (!fpriv->evf_mgr.fd_closing) {
> + fpriv->evf_mgr.fd_closing = true;
> + amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
> + amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
> + }
> amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
> amdgpu_vm_fini(adev, &fpriv->vm);
>
More information about the amd-gfx
mailing list