summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
diff options
context:
space:
mode:
authorPhilip Yang <Philip.Yang@amd.com>2021-06-21 18:51:26 -0400
committerAlex Deucher <alexander.deucher@amd.com>2021-06-30 00:18:23 -0400
commitdcdb4d904b4bd3078fe8d4d24b1658560d6078ef (patch)
tree38ef0795334338ed1e836582a83beda65e77924b /drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
parent75ae84c89b136a5c0193ab7064b03cddfcebba39 (diff)
downloadlinux-dcdb4d904b4bd3078fe8d4d24b1658560d6078ef.tar.gz
linux-dcdb4d904b4bd3078fe8d4d24b1658560d6078ef.tar.bz2
linux-dcdb4d904b4bd3078fe8d4d24b1658560d6078ef.zip
drm/amdkfd: fix sysfs kobj leak
3 cases of kobj leak, which causes memory leak: kobj_type must have release() method to free memory from release callback. Don't need NULL default_attrs to init kobj. sysfs files created under kobj_status should be removed with kobj_status as parent kobject. Remove queue sysfs files when releasing queue from process MMU notifier release callback. Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c1
1 files changed, 1 insertions, 0 deletions
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 95a6c36cea4c..243dd1efcdbf 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -153,6 +153,7 @@ void pqm_uninit(struct process_queue_manager *pqm)
if (pqn->q && pqn->q->gws)
amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,
pqn->q->gws);
+ kfd_procfs_del_queue(pqn->q);
uninit_queue(pqn->q);
list_del(&pqn->process_queue_list);
kfree(pqn);