]> www.infradead.org Git - users/jedix/linux-maple.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 18:01:52 +0000 (14:01 -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>
(cherry picked from commit 7e2a5b0a9a165a7c51274aa01b18be29491b4345)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c

index c3ace8030530fe0dea36620df30d68a0258afec9..8190c24a649a246ee10cdbca6896f60282d8e5a2 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;
        }