Skip to content

Commit 28c5c48

Browse files
tititiou36alexdeucher
authored andcommitted
drm/amdgpu: Fix missing unlocking in an error path in amdgpu_userq_create()
If kasprintf() fails, some mutex still need to be released to avoid locking issue, as already done in all other error handling path. Fixes: c03ea34 ("drm/amdgpu: add support of debugfs for mqd information") Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/all/366557fa7ca8173fd78c58336986ca56953369b9.1752087753.git.christophe.jaillet@wanadoo.fr/ Signed-off-by: Alex Deucher <[email protected]>
1 parent 41ab92d commit 28c5c48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,10 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
521521
}
522522

523523
queue_name = kasprintf(GFP_KERNEL, "queue-%d", qid);
524-
if (!queue_name)
525-
return -ENOMEM;
524+
if (!queue_name) {
525+
r = -ENOMEM;
526+
goto unlock;
527+
}
526528

527529
#if defined(CONFIG_DEBUG_FS)
528530
/* Queue dentry per client to hold MQD information */

0 commit comments

Comments
 (0)