drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
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")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
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 513bbc543f40..bce97318965c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -520,8 +520,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;
+ }
/* Queue dentry per client to hold MQD information */
queue->debugfs_queue = debugfs_create_dir(queue_name, filp->debugfs_client);
--
2.50.0
On Wed, Jul 9, 2025 at 3:28 PM Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote: > > 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") > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> and pushed out to drm-misc-next. Alex > --- > 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 513bbc543f40..bce97318965c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > @@ -520,8 +520,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; > + } > > /* Queue dentry per client to hold MQD information */ > queue->debugfs_queue = debugfs_create_dir(queue_name, filp->debugfs_client); > -- > 2.50.0 >
On Wed, Jul 9, 2025 at 3:28 PM Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote: > > 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") > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> @Christian Koenig @Sunil Khatri can you pick this up for drm-misc? Thanks, Alex > --- > 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 513bbc543f40..bce97318965c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > @@ -520,8 +520,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; > + } > > /* Queue dentry per client to hold MQD information */ > queue->debugfs_queue = debugfs_create_dir(queue_name, filp->debugfs_client); > -- > 2.50.0 >
© 2016 - 2025 Red Hat, Inc.