[PATCH next] drm/amdgpu: unlock on error in amdgpu_userq_create()
Dan Carpenter
dan.carpenter at linaro.org
Tue Jul 15 22:58:47 UTC 2025
We need to drop a couple locks before returning if the kasprintf() fails.
Fixes: c03ea34cbf88 ("drm/amdgpu: add support of debugfs for mqd information")
Signed-off-by: Dan Carpenter <dan.carpenter at linaro.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 492f1089316f..c3ace8030530 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -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 */
--
2.47.2
More information about the dri-devel
mailing list