Skip to contentSkip to conversation

drm/amdgpu/userq: fix error handling of invalid doorbell

PATCH In review Alex Deucher 4 participants 4 messages Aug 22, 2025 – Aug 27, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/userq: fix error handling of invalid doorbell

If the doorbell is invalid, be sure to set the r to an error state so the function returns an error.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -0
index 424831997cb1a..28242ec2215da 100644
@@ -426,6 +426,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
 	if (index == (uint64_t)-EINVAL) {
 		drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n");
 		kfree(queue);
+		r = -EINVAL;
 		goto unlock;
 	}
 
Signature · 1 line
2.50.1
#1 lore raw

Ping?

Quoted 24 lines · Alex Deucher

If the doorbell is invalid, be sure to set the r to an error state so the function returns an error.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -1
index 424831997cb1a..28242ec2215da 100644
@@ -426,6 +426,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
        if (index == (uint64_t)-EINVAL) {
                drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n");
                kfree(queue);
+               r = -EINVAL;
                goto unlock;
        }
 
--

2.50.1

Reviewed-by David (Ming Qiang) Wu
#2 lore raw

Agreed with the change. Thanks!

Quoted 26 lines · Alex Deucher

Ping?

Quoted 23 lines · Alex Deucher

If the doorbell is invalid, be sure to set the r to an error state so the function returns an error.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -1
index 424831997cb1a..28242ec2215da 100644
@@ -426,6 +426,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
         if (index == (uint64_t)-EINVAL) {
                 drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n");
                 kfree(queue);
+               r = -EINVAL;
                 goto unlock;
         }
 
--

2.50.1

#3 lore raw
In reply to Alex Deucher

[AMD Official Use Only - AMD Internal Distribution Only]

This patch is Reviewed-by: "[email protected]"

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, August 27, 2025 12:29 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/userq: fix error handling of invalid doorbell

Ping?

Quoted 25 lines · Alex Deucher

If the doorbell is invalid, be sure to set the r to an error state so the function returns an error.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +1 -1
index 424831997cb1a..28242ec2215da 100644
@@ -426,6 +426,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
        if (index == (uint64_t)-EINVAL) {
                drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n");
                kfree(queue);
+               r = -EINVAL;
                goto unlock;
        }
 
--

2.50.1