]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdkfd: fix a memory leak in device_queue_manager_init()
authorHaoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Thu, 8 Jan 2026 07:18:22 +0000 (15:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Feb 2026 15:44:22 +0000 (16:44 +0100)
commit1dfaa8c68c5cdcb70003cf684a3ef95fbbd9aebe
treea65d1dc931a017b1fcaedb6cbd532be63237f7c3
parentc71aa4bb528ae6f8fd7577a0a39e5a03c60b04fb
drm/amdkfd: fix a memory leak in device_queue_manager_init()

commit 80614c509810fc051312d1a7ccac8d0012d6b8d0 upstream.

If dqm->ops.initialize() fails, add deallocate_hiq_sdma_mqd()
to release the memory allocated by allocate_hiq_sdma_mqd().
Move deallocate_hiq_sdma_mqd() up to ensure proper function
visibility at the point of use.

Fixes: 11614c36bc8f ("drm/amdkfd: Allocate MQD trunk for HIQ and SDMA")
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b7cccc8286bb9919a0952c812872da1dcfe9d390)
Cc: stable@vger.kernel.org
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c