]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 14:55:49 +0000 (16:55 +0200)
commit c767d74a9cdd1042046d02319d16b85d9aa8a8aa upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c

index aac0de86f3e8c81f96d225b96a84e135dcab8138..a966ede1dba24ed36f273d962702586b612221ae 100644 (file)
@@ -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;
        }