]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amdgpu/userq: fix error handling of invalid doorbell
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 22 Aug 2025 16:12:37 +0000 (12:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Aug 2025 17:57:51 +0000 (13:57 -0400)
If the doorbell is invalid, be sure to set the r to an error
state so the function returns an error.

Reviewed-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c

index 86cabb20bff14b16d549226d9b4a056368e72196..f72de06a4ac821b95b8fc64bd84b0896adbce826 100644 (file)
@@ -471,6 +471,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;
        }