lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c124806a-1cd5-4628-96c3-70e941de747e@amd.com>
Date: Mon, 5 Jan 2026 13:59:55 -0500
From: "Kuehling, Felix" <felix.kuehling@....com>
To: Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>, alexander.deucher@....com,
 christian.koenig@....com, airlied@...il.com, simona@...ll.ch
Cc: amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amdkfd: fix a memory leak in
 device_queue_manager_init()

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@...c.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@....com>

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

Thanks,
   Felix


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ