Skip to content

Commit 4135899

Browse files
fxkamdalexdeucher
authored andcommitted
drm/amdkfd: Fix memory leak in create_process failure
Fix memory leak due to a leaked mmget reference on an error handling code path that is triggered when attempting to create KFD processes while a GPU reset is in progress. Fixes: 0ab2d75 ("drm/amdkfd: prepare per-process debug enable and disable") CC: Xiaogang Chen <xiaogang.chen@amd.com> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Tested-by: Harish Kasiviswanthan <Harish.Kasiviswanthan@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 38caf64 commit 4135899

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_process.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,9 @@ struct kfd_process *kfd_create_process(struct task_struct *thread)
819819
mutex_lock(&kfd_processes_mutex);
820820

821821
if (kfd_is_locked()) {
822-
mutex_unlock(&kfd_processes_mutex);
823822
pr_debug("KFD is locked! Cannot create process");
824-
return ERR_PTR(-EINVAL);
823+
process = ERR_PTR(-EINVAL);
824+
goto out;
825825
}
826826

827827
/* A prior open of /dev/kfd could have already created the process. */

0 commit comments

Comments
 (0)