AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: Zhu Lingshan <lingshan.zhu@amd.com>, alexander.deucher@amd.com
Cc: ray.huang@amd.com, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] amdkfd: properly free gang_ctx_bo when failed to init user queue
Date: Wed, 5 Feb 2025 11:49:59 -0500	[thread overview]
Message-ID: <d77bc91e-0401-4f52-bb63-ded0b0930fac@amd.com> (raw)
In-Reply-To: <20250205080802.1162861-1-lingshan.zhu@amd.com>



On 2025-02-05 3:08, Zhu Lingshan wrote:
> The destructor of a gtt bo is declared as
> void amdgpu_amdkfd_free_gtt_mem(struct amdgpu_device *adev, void **mem_obj);
> Which takes void** as the second parameter.
> 
> GCC allows passing void* to the function because void* can be implicitly
> casted to any other types, so it can pass compiling.
> 
> However, passing this void* parameter into the function's
> execution process(which expects void** and dereferencing void**)
> will result in errors.
> 
> Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
> Fixes: fb91065851cd ("drm/amdkfd: Refactor queue wptr_bo GART mapping")

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>


> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> index 750f967fecf5..0ce8d49ca16e 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> @@ -295,7 +295,7 @@ static int init_user_queue(struct process_queue_manager *pqm,
>  	return 0;
>  
>  free_gang_ctx_bo:
> -	amdgpu_amdkfd_free_gtt_mem(dev->adev, (*q)->gang_ctx_bo);
> +	amdgpu_amdkfd_free_gtt_mem(dev->adev, &(*q)->gang_ctx_bo);
>  cleanup:
>  	uninit_queue(*q);
>  	*q = NULL;


      reply	other threads:[~2025-02-05 17:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05  8:08 [PATCH] amdkfd: properly free gang_ctx_bo when failed to init user queue Zhu Lingshan
2025-02-05 16:49 ` Felix Kuehling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d77bc91e-0401-4f52-bb63-ded0b0930fac@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=lingshan.zhu@amd.com \
    --cc=ray.huang@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox