]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: Fix missing unlocking in an error path in amdgpu_userq_create()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 9 Jul 2025 19:02:51 +0000 (21:02 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 16 Jul 2025 19:46:04 +0000 (15:46 -0400)
If kasprintf() fails, some mutex still need to be released to avoid locking
issue, as already done in all other error handling path.

Fixes: c03ea34cbf88 ("drm/amdgpu: add support of debugfs for mqd information")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/all/366557fa7ca8173fd78c58336986ca56953369b9.1752087753.git.christophe.jaillet@wanadoo.fr/
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c

index b1b80efc7993d80bfadb9ecf14686052a3fe74a8..941f61f920057fb451581d5c6918395ab6a5eb8e 100644 (file)
@@ -521,8 +521,10 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
        }
 
        queue_name = kasprintf(GFP_KERNEL, "queue-%d", qid);
-       if (!queue_name)
-               return -ENOMEM;
+       if (!queue_name) {
+               r = -ENOMEM;
+               goto unlock;
+       }
 
 #if defined(CONFIG_DEBUG_FS)
        /* Queue dentry per client to hold MQD information   */