mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kuehling, Felix" <felix.kuehling@amd.com>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	airlied@gmail.com, simona@ffwll.ch
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amdkfd: fix a memory leak in device_queue_manager_init()
Date: Mon, 5 Jan 2026 13:59:55 -0500	[thread overview]
Message-ID: <c124806a-1cd5-4628-96c3-70e941de747e@amd.com> (raw)
In-Reply-To: <20260104131532.3978895-1-lihaoxiang@isrc.iscas.ac.cn>

On 2026-01-04 08:15, Haoxiang Li wrote:
> If dqm->ops.initialize() fails, add deallocate_hiq_sdma_mqd()
> to release the memory allocated by allocate_hiq_sdma_mqd().
>
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index d7a2e7178ea9..58a8d90c1533 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -3042,6 +3042,9 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_node *dev)
>   		return dqm;
>   	}
>   
> +	if (!dev->kfd->shared_resources.enable_mes)
> +		deallocate_hiq_sdma_mqd(dev, &dqm->hiq_sdma_mqd);
> +

I thing the idea is right. But see the report from the kernel test 
robot. Either move deallocate_hiq_sdma_mqd up or add a forward declaration.

With that fixed, the patch is

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

If you send an updated patch, I'll apply it to amd-staging-drm-next.

Thanks,
   Felix


>   out_free:
>   	kfree(dqm);
>   	return NULL;

      parent reply	other threads:[~2026-01-05 19:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-04 13:15 Haoxiang Li
2026-01-04 22:41 ` kernel test robot
2026-01-05 18:59 ` Kuehling, Felix [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=c124806a-1cd5-4628-96c3-70e941de747e@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lihaoxiang@isrc.iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simona@ffwll.ch \
    /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

all inboxes | Powered by JetHome®